diff --git a/agc_1-X/trunk/LANG_admin/LANG_admin/astguiclient/AST_inboundEXTstats.php b/agc_1-X/trunk/LANG_admin/LANG_admin/astguiclient/AST_inboundEXTstats.php deleted file mode 100644 index db7d0806..00000000 --- a/agc_1-X/trunk/LANG_admin/LANG_admin/astguiclient/AST_inboundEXTstats.php +++ /dev/null @@ -1,369 +0,0 @@ - -require("dbconnect.php"); - -##### depricated -#require_once("htglobalize.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$query_date=$_GET["query_date"]; if (!$query_date) {$query_date=$_POST["query_date"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -# AST_inboundEXTstats.php - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $NOW_DATE;} -if (!$server_ip) {$server_ip = '10.10.11.11';} - -$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='$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++; - } -?> - - -
- - - -echo"\n"; -#echo"\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";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' and extension='$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 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 >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' and extension='$group' 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 >= '$query_date 00:00:01' and start_time <= '$query_date 23:59:59' and server_ip='$server_ip' and extension='$group';";
-$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("%-10s", $row[0]);
- $CIDname = sprintf("%-15s", $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 >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and server_ip='$server_ip' and extension='$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 call_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and server_ip='$server_ip' and extension='$group' 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 >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and server_ip='$server_ip' and extension='$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 call_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and server_ip='$server_ip' and extension='$group' 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 >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and server_ip='$server_ip' and extension='$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 call_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and server_ip='$server_ip' and extension='$group' 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 >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and server_ip='$server_ip' and extension='$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 call_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and server_ip='$server_ip' and extension='$group' 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/agc_1-X/trunk/LANG_admin/LANG_admin/astguiclient/admin.php b/agc_1-X/trunk/LANG_admin/LANG_admin/astguiclient/admin.php
deleted file mode 100644
index adb0c292..00000000
--- a/agc_1-X/trunk/LANG_admin/LANG_admin/astguiclient/admin.php
+++ /dev/null
@@ -1,1627 +0,0 @@
-
-
-### AST GUI database administration
-
-require("dbconnect.php");
-
-##### depricated
-#require_once("htglobalize.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-$ADD=$_GET["ADD"]; if (!$ADD) {$ADD=$_POST["ADD"];}
-$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];}
-$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];}
-$full_name=$_GET["full_name"]; if (!$full_name) {$full_name=$_POST["full_name"];}
-$user_level=$_GET["user_level"]; if (!$user_level) {$user_level=$_POST["user_level"];}
-$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];}
-$status=$_GET["status"]; if (!$status) {$status=$_POST["status"];}
-$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];}
-$server_id=$_GET["server_id"]; if (!$server_id) {$server_id=$_POST["server_id"];}
-$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];}
-$dialplan_number=$_GET["dialplan_number"]; if (!$dialplan_number) {$dialplan_number=$_POST["dialplan_number"];}
-$voicemail_id=$_GET["voicemail_id"]; if (!$voicemail_id) {$voicemail_id=$_POST["voicemail_id"];}
-$phone_ip=$_GET["phone_ip"]; if (!$phone_ip) {$phone_ip=$_POST["phone_ip"];}
-$computer_ip=$_GET["computer_ip"]; if (!$computer_ip) {$computer_ip=$_POST["computer_ip"];}
-$login=$_GET["login"]; if (!$login) {$login=$_POST["login"];}
-$active=$_GET["active"]; if (!$active) {$active=$_POST["active"];}
-$phone_type=$_GET["phone_type"]; if (!$phone_type) {$phone_type=$_POST["phone_type"];}
-$fullname=$_GET["fullname"]; if (!$fullname) {$fullname=$_POST["fullname"];}
-$company=$_GET["company"]; if (!$company) {$company=$_POST["company"];}
-$picture=$_GET["picture"]; if (!$picture) {$picture=$_POST["picture"];}
-$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];}
-$local_gmt=$_GET["local_gmt"]; if (!$local_gmt) {$local_gmt=$_POST["local_gmt"];}
-$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"]; if (!$ASTmgrUSERNAME) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];}
-$ASTmgrSECRET=$_GET["ASTmgrSECRET"]; if (!$ASTmgrSECRET) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];}
-$login_user=$_GET["login_user"]; if (!$login_user) {$login_user=$_POST["login_user"];}
-$login_pass=$_GET["login_pass"]; if (!$login_pass) {$login_pass=$_POST["login_pass"];}
-$login_campaign=$_GET["login_campaign"]; if (!$login_campaign) {$login_campaign=$_POST["login_campaign"];}
-$park_on_extension=$_GET["park_on_extension"]; if (!$park_on_extension) {$park_on_extension=$_POST["park_on_extension"];}
-$conf_on_extension=$_GET["conf_on_extension"]; if (!$conf_on_extension) {$conf_on_extension=$_POST["conf_on_extension"];}
-$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"]; if (!$VICIDIAL_park_on_extension) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];}
-$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"]; if (!$VICIDIAL_park_on_filename) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];}
-$monitor_prefix=$_GET["monitor_prefix"]; if (!$monitor_prefix) {$monitor_prefix=$_POST["monitor_prefix"];}
-$recording_exten=$_GET["recording_exten"]; if (!$recording_exten) {$recording_exten=$_POST["recording_exten"];}
-$voicemail_exten=$_GET["voicemail_exten"]; if (!$voicemail_exten) {$voicemail_exten=$_POST["voicemail_exten"];}
-$voicemail_dump_exten=$_GET["voicemail_dump_exten"]; if (!$voicemail_dump_exten) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];}
-$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];}
-$dtmf_send_extension=$_GET["dtmf_send_extension"]; if (!$dtmf_send_extension) {$dtmf_send_extension=$_POST["dtmf_send_extension"];}
-$call_out_number_group=$_GET["call_out_number_group"]; if (!$call_out_number_group) {$call_out_number_group=$_POST["call_out_number_group"];}
-$client_browser=$_GET["client_browser"]; if (!$client_browser) {$client_browser=$_POST["client_browser"];}
-$install_directory=$_GET["install_directory"]; if (!$install_directory) {$install_directory=$_POST["install_directory"];}
-$local_web_callerID_URL=$_GET["local_web_callerID_URL"]; if (!$local_web_callerID_URL) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];}
-$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"]; if (!$VICIDIAL_web_URL) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];}
-$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"]; if (!$AGI_call_logging_enabled) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];}
-$user_switching_enabled=$_GET["user_switching_enabled"]; if (!$user_switching_enabled) {$user_switching_enabled=$_POST["user_switching_enabled"];}
-$conferencing_enabled=$_GET["conferencing_enabled"]; if (!$conferencing_enabled) {$conferencing_enabled=$_POST["conferencing_enabled"];}
-$admin_hangup_enabled=$_GET["admin_hangup_enabled"]; if (!$admin_hangup_enabled) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];}
-$admin_hijack_enabled=$_GET["admin_hijack_enabled"]; if (!$admin_hijack_enabled) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];}
-$admin_monitor_enabled=$_GET["admin_monitor_enabled"]; if (!$admin_monitor_enabled) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];}
-$call_parking_enabled=$_GET["call_parking_enabled"]; if (!$call_parking_enabled) {$call_parking_enabled=$_POST["call_parking_enabled"];}
-$updater_check_enabled=$_GET["updater_check_enabled"]; if (!$updater_check_enabled) {$updater_check_enabled=$_POST["updater_check_enabled"];}
-$AFLogging_enabled=$_GET["AFLogging_enabled"]; if (!$AFLogging_enabled) {$AFLogging_enabled=$_POST["AFLogging_enabled"];}
-$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"]; if (!$QUEUE_ACTION_enabled) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];}
-$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"]; if (!$CallerID_popup_enabled) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];}
-$voicemail_button_enabled=$_GET["voicemail_button_enabled"]; if (!$voicemail_button_enabled) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];}
-$enable_fast_refresh=$_GET["enable_fast_refresh"]; if (!$enable_fast_refresh) {$enable_fast_refresh=$_POST["enable_fast_refresh"];}
-$fast_refresh_rate=$_GET["fast_refresh_rate"]; if (!$fast_refresh_rate) {$fast_refresh_rate=$_POST["fast_refresh_rate"];}
-$enable_persistant_mysql=$_GET["enable_persistant_mysql"]; if (!$enable_persistant_mysql) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];}
-$auto_dial_next_number=$_GET["auto_dial_next_number"]; if (!$auto_dial_next_number) {$auto_dial_next_number=$_POST["auto_dial_next_number"];}
-$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];}
-$DBX_server=$_GET["DBX_server"]; if (!$DBX_server) {$DBX_server=$_POST["DBX_server"];}
-$DBX_database=$_GET["DBX_database"]; if (!$DBX_database) {$DBX_database=$_POST["DBX_database"];}
-$DBX_user=$_GET["DBX_user"]; if (!$DBX_user) {$DBX_user=$_POST["DBX_user"];}
-$DBX_pass=$_GET["DBX_pass"]; if (!$DBX_pass) {$DBX_pass=$_POST["DBX_pass"];}
-$DBX_port=$_GET["DBX_port"]; if (!$DBX_port) {$DBX_port=$_POST["DBX_port"];}
-$DBY_server=$_GET["DBY_server"]; if (!$DBY_server) {$DBY_server=$_POST["DBY_server"];}
-$DBY_database=$_GET["DBY_database"]; if (!$DBY_database) {$DBY_database=$_POST["DBY_database"];}
-$DBY_user=$_GET["DBY_user"]; if (!$DBY_user) {$DBY_user=$_POST["DBY_user"];}
-$DBY_pass=$_GET["DBY_pass"]; if (!$DBY_pass) {$DBY_pass=$_POST["DBY_pass"];}
-$DBY_port=$_GET["DBY_port"]; if (!$DBY_port) {$DBY_port=$_POST["DBY_port"];}
-$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];}
-$old_extension=$_GET["old_extension"]; if (!$old_extension) {$old_extension=$_POST["old_extension"];}
-$old_server_ip=$_GET["old_server_ip"]; if (!$old_server_ip) {$old_server_ip=$_POST["old_server_ip"];}
-$old_server_id=$_GET["old_server_id"]; if (!$old_server_id) {$old_server_id=$_POST["old_server_id"];}
-$server_description=$_GET["server_description"]; if (!$server_description) {$server_description=$_POST["server_description"];}
-$asterisk_version=$_GET["asterisk_version"]; if (!$asterisk_version) {$asterisk_version=$_POST["asterisk_version"];}
-$max_vicidial_trunks=$_GET["max_vicidial_trunks"]; if (!$max_vicidial_trunks) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];}
-$telnet_host=$_GET["telnet_host"]; if (!$telnet_host) {$telnet_host=$_POST["telnet_host"];}
-$telnet_port=$_GET["telnet_port"]; if (!$telnet_port) {$telnet_port=$_POST["telnet_port"];}
-$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"]; if (!$ASTmgrUSERNAMEupdate) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];}
-$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"]; if (!$ASTmgrUSERNAMElisten) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];}
-$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"]; if (!$ASTmgrUSERNAMEsend) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];}
-$answer_transfer_agent=$_GET["answer_transfer_agent"]; if (!$answer_transfer_agent) {$answer_transfer_agent=$_POST["answer_transfer_agent"];}
-$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];}
-$old_conf_exten=$_GET["old_conf_exten"]; if (!$old_conf_exten) {$old_conf_exten=$_POST["old_conf_exten"];}
-$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];}
-$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];}
-$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];}
-$CoNfIrM=$_GET["CoNfIrM"]; if (!$CoNfIrM) {$CoNfIrM=$_POST["CoNfIrM"];}
-
-### AST GUI database administration
-### admin.php
-###
-### 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
-
-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;
-}
-
-$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 = " | ASTERISK ADMIN - Logout | echo date("l F j, Y G:i:s A") ?> |
| LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS | |
| SHOW ALL CONFERENCES | ADD A NEW CONFERENCE | |
|
-
-######################
-# ADD=1 display the ADD NEW PHONE FORM SCREEN
-######################
-
-if ($ADD==1)
-{
-echo "";
-
-echo " ADD A NEW PHONE | |