LICENSE: GPLv2 # # AST GUI database administration # # 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 # $version = '1.1.10-3'; $build = '60427-1137'; 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["user_level"])) {$user_level=$_GET["user_level"];} elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} 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["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"];} 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='$local_web_callerID_URL', VICIDIAL_web_URL='$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"; ?>