diff --git a/LANG_www/agc_es/conf_exten_check.php b/LANG_www/agc_es/conf_exten_check.php index c8215eb1..3094eaac 100644 --- a/LANG_www/agc_es/conf_exten_check.php +++ b/LANG_www/agc_es/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # 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 @@ -54,12 +54,13 @@ # 100727-2209 - Added timer actions for hangup, extension, callmenu and ingroup as well as destination # 101123-1105 - Added api manual dial queue feature to external_dial function # 101208-0308 - Moved the Calls in Queue count and other counts outside of the autodial section (issue 406) +# 110610-0059 - Small fix for manual dial calls lasting more than 100 minutes in real-time report # -$version = '2.4-29'; -$build = '101208-0308'; +$version = '2.4-30'; +$build = '110610-0059'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=36; +$mysql_log_count=38; $one_mysql_log=0; $DB=0; @@ -112,10 +113,15 @@ if ($qm_conf_ct > 0) ########################################### if ($non_latin < 1) -{ -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -} + { + $user=ereg_replace("[^-_0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass); + } +else + { + $user = ereg_replace("'|\"|\\\\|;","",$user); + $pass = ereg_replace("'|\"|\\\\|;","",$pass); + } # default optional vars if not set if (!isset($format)) {$format="text";} @@ -149,7 +155,6 @@ if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) } 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"; @@ -176,30 +181,29 @@ else } 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) + 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 + else { - if ($client == 'vdc') { $Acount=0; @@ -321,6 +325,15 @@ echo " $row=mysql_fetch_row($rslt); $AcalleridCOUNT=$row[0]; + if ( ($AcalleridCOUNT > 0) and (eregi("INCALL",$Astatus)) and (preg_match("/^M/",$Acallerid)) ) + { + $updateNOW_TIME = date("Y-m-d H:i:s"); + $stmt="UPDATE vicidial_auto_calls set last_update_time='$updateNOW_TIME' where callerid='$Acallerid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03038',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ( ($AcalleridCOUNT < 1) and (eregi("INCALL",$Astatus)) and (strlen($Aagent_log_id) > 0) ) { $DEADcustomer++; @@ -374,6 +387,15 @@ echo " $row=mysql_fetch_row($rslt); $AcalleridCOUNT=$row[0]; + if ( ($AcalleridCOUNT > 0) and (eregi("INCALL",$Astatus)) ) + { + $updateNOW_TIME = date("Y-m-d H:i:s"); + $stmt="UPDATE vicidial_auto_calls set last_update_time='$updateNOW_TIME' where callerid='$Acallerid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03037',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ( ($AcalleridCOUNT < 1) and (eregi("INCALL",$Astatus)) and (strlen($Aagent_log_id) > 0) ) { $DEADcustomer++; @@ -678,40 +700,40 @@ echo " if ($format=='debug') {echo "\n";} } } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; + $channels_list = ($channels_list + $sip_list); + echo "$channels_list|"; - $counter=0; - $countecho=''; - while($total_conf > $counter) + $counter=0; + $countecho=''; + while($total_conf > $counter) { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; + $counter++; + $countecho = "$countecho$ChannelA[$counter] ~"; + # echo "$ChannelA[$counter] ~"; } echo "$countecho\n"; } - if ($ACTION == 'register') +if ($ACTION == 'register') { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) + $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 + 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); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03013',$user,$server_ip,$session_name,$one_mysql_log);} } - echo "Conferencia $conf_exten Ha sido registrado para $exten\n"; + echo "Conferencia $conf_exten Ha sido registrado para $exten\n"; } diff --git a/LANG_www/agc_es/vicidial.php b/LANG_www/agc_es/vicidial.php index c4151a6a..7e3c2ff0 100644 --- a/LANG_www/agc_es/vicidial.php +++ b/LANG_www/agc_es/vicidial.php @@ -353,10 +353,11 @@ # 110526-1723 - Added webphone_auto_answer option # 110528-1033 - Added waiting_on_dispo manual dial check # 110531-2158 - Added callback_days_limit campaign feature +# 110619-2005 - Added disable_dispo_ options # -$version = '2.4-330c'; -$build = '110531-2158'; +$version = '2.4-331c'; +$build = '110619-2005'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=72; $one_mysql_log=0; @@ -1347,7 +1348,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1447,7 +1448,17 @@ echo " 0) ) + {$disable_dispo_screen=1;} + if ( ($VU_agent_lead_search_override == 'ENABLED') or ($VU_agent_lead_search_override == 'DISABLED') ) {$agent_lead_search = $VU_agent_lead_search_override;} $AllowManualQueueCalls=1; @@ -3358,6 +3369,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var custom_3way_button_transfer_enabled=''; var custom_3way_button_transfer_park=''; var waiting_on_dispo=0; + var disable_dispo_screen=''; + var disable_dispo_status=''; var DiaLControl_auto_HTML = "\"\"Comienzo\""; var DiaLControl_auto_HTML_ready = "\"\"Comienzo\""; var DiaLControl_auto_HTML_OFF = "\"\"Comienzo\""; @@ -7948,6 +7961,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { if (hotkeysused == 'YES') { + alt_dial_active = 0; + alt_dial_status_display = 0; reselect_alt_dial = 0; manual_auto_hotkey = 1; } @@ -7958,6 +7973,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { if (hotkeysused == 'YES') { + alt_dial_active = 0; + alt_dial_status_display = 0; manual_auto_hotkey = 1; } else @@ -7988,6 +8005,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { manual_auto_hotkey = 1; alt_dial_active=0; + alt_dial_status_display = 0; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; document.getElementById("MainStatuSSpan").innerHTML = ''; @@ -8238,68 +8256,76 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // Generate the Call Disposition Chooser panel function DispoSelectContent_create(taskDSgrp,taskDSstage) { - if (customer_3way_hangup_dispo_message.length > 1) + if (disable_dispo_screen > 0) { - document.getElementById("Dispo3wayMessage").innerHTML = "
" + customer_3way_hangup_dispo_message + "
"; - } - if (APIManualDialQueue > 0) - { - document.getElementById("DispoManualQueueMessage").innerHTML = "
Manual Dial Queue Calls Waiting: " + APIManualDialQueue + "
"; - } - if (per_call_notes == 'ENABLED') - { - var test_notes = document.vicidial_form.call_notes_dispo.value; - if (test_notes.length > 0) - {document.vicidial_form.call_notes.value = document.vicidial_form.call_notes_dispo.value} - document.getElementById("PerCallNotasContent").innerHTML = "
Call Notas:
"; + document.vicidial_form.DispoSelection.value = disable_dispo_status; + DispoSelect_submit(); } else { - document.getElementById("PerCallNotasContent").innerHTML = ""; - } - - HidEGenDerPulldown(); - AgentDispoing = 1; - var CBflag = ''; - var VD_statuses_ct_half = parseInt(VARSELstatuses_ct / 2); - var dispo_HTML = "
LLAMADA DISPOSITION
"; - var loop_ct = 0; - var print_ct = 0; - while (loop_ct < VD_statuses_ct) - { - if (VARSELstatuses[loop_ct] == 'Y') + if (customer_3way_hangup_dispo_message.length > 1) { - if (VARCBstatuses[loop_ct] == 'Y') - {CBflag = '*';} - else - {CBflag = '';} - if (taskDSgrp == VARstatuses[loop_ct]) - { - dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; - } - else - { - dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; - } - if (print_ct == VD_statuses_ct_half) - {dispo_HTML = dispo_HTML + "
";} - print_ct++; + document.getElementById("Dispo3wayMessage").innerHTML = "
" + customer_3way_hangup_dispo_message + "
"; + } + if (APIManualDialQueue > 0) + { + document.getElementById("DispoManualQueueMessage").innerHTML = "
Manual Dial Queue Calls Waiting: " + APIManualDialQueue + "
"; + } + if (per_call_notes == 'ENABLED') + { + var test_notes = document.vicidial_form.call_notes_dispo.value; + if (test_notes.length > 0) + {document.vicidial_form.call_notes.value = document.vicidial_form.call_notes_dispo.value} + document.getElementById("PerCallNotasContent").innerHTML = "
Call Notas:
"; + } + else + { + document.getElementById("PerCallNotasContent").innerHTML = ""; } - loop_ct++; - } - dispo_HTML = dispo_HTML + "
"; - if (taskDSstage == 'ReSET') {document.vicidial_form.DispoSelection.value = '';} - else {document.vicidial_form.DispoSelection.value = taskDSgrp;} - - document.getElementById("DispoSelectContent").innerHTML = dispo_HTML; - if (focus_blur_enabled==1) - { - document.inert_form.inert_button.focus(); - document.inert_form.inert_button.blur(); + HidEGenDerPulldown(); + AgentDispoing = 1; + var CBflag = ''; + var VD_statuses_ct_half = parseInt(VARSELstatuses_ct / 2); + var dispo_HTML = "
LLAMADA DISPOSITION
"; + var loop_ct = 0; + var print_ct = 0; + while (loop_ct < VD_statuses_ct) + { + if (VARSELstatuses[loop_ct] == 'Y') + { + if (VARCBstatuses[loop_ct] == 'Y') + {CBflag = '*';} + else + {CBflag = '';} + if (taskDSgrp == VARstatuses[loop_ct]) + { + dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; + } + else + { + dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; + } + if (print_ct == VD_statuses_ct_half) + {dispo_HTML = dispo_HTML + "
";} + print_ct++; + } + loop_ct++; + } + dispo_HTML = dispo_HTML + "
"; + + if (taskDSstage == 'ReSET') {document.vicidial_form.DispoSelection.value = '';} + else {document.vicidial_form.DispoSelection.value = taskDSgrp;} + + document.getElementById("DispoSelectContent").innerHTML = dispo_HTML; + if (focus_blur_enabled==1) + { + document.inert_form.inert_button.focus(); + document.inert_form.inert_button.blur(); + } + if (my_callback_option == 'CHECKED') + {document.vicidial_form.CallBackOnlyMe.checked=true;} } - if (my_callback_option == 'CHECKED') - {document.vicidial_form.CallBackOnlyMe.checked=true;} } // ################################################################################ @@ -8565,6 +8591,12 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (DispoChoice.length < 1) {alert_box("Usted debe seleccionar una disposición");} else { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + var man_status = ""; + document.getElementById("MainStatuSSpan").innerHTML = man_status; + alt_dial_status_display = 0; + } document.getElementById("CusTInfOSpaN").innerHTML = ""; document.getElementById("CusTInfOSpaN").style.background = panel_bgcolor; var regCBstatus = new RegExp(' ' + DispoChoice + ' ',"ig"); @@ -9550,6 +9582,9 @@ if ($useIE > 0) { HKdispo_display = 4; HKfinish=1; + alt_phone_dialing=starting_alt_phone_dialing; + alt_dial_active = 0; + alt_dial_status_display = 0; document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; showDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); @@ -9607,6 +9642,9 @@ else showDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + alt_phone_dialing=starting_alt_phone_dialing; + alt_dial_active = 0; + alt_dial_status_display = 0; dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); if (custom_fields_enabled > 0) { @@ -10664,6 +10702,7 @@ function phone_number_format(formatphone) { { move_on=0; alert_box("YOU MUST BE PAUSED TO VIEW YOUR LLAMADA LOG"); + // alert("debug: " + AutoDialWaiting + "|" + VD_live_customer_call + "|" + alt_dial_active + "|" + MD_channel_look + "|" + in_lead_preview_state); } } if (move_on == 1) diff --git a/UPGRADE b/UPGRADE index ee7e5f63..c231be8a 100644 --- a/UPGRADE +++ b/UPGRADE @@ -613,6 +613,9 @@ OTHER CHANGES: 135. Added ability to disable the Disposition screen on the agent interface. +136. Added install.pl options to define conf file and copy web language + translation files. + diff --git a/install.pl b/install.pl index 34dbf25a..80fc294c 100644 --- a/install.pl +++ b/install.pl @@ -2,7 +2,7 @@ # install.pl version 2.4 # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES @@ -23,6 +23,7 @@ # 91123-0001 - Added FTP2 directory to /var/spool/asterisk/monitorDONE # 100428-0936 - Added DB custom user/pass fields # 101217-0520 - Added PREPROCESS directory +# 110619-2153 - Added languages install and conf file specify options # ############################################ @@ -31,7 +32,8 @@ # default paths. # # default path to astguiclient configuration file: -$PATHconf = '/etc/astguiclient.conf'; +$defaultPATHconf = '/etc/astguiclient.conf'; +$PATHconf = $defaultPATHconf; # default path to home directory: $PATHhome = '/usr/share/astguiclient'; # default path to astguiclient logs directory: @@ -146,7 +148,7 @@ if (length($ARGV[0])>1) if ($args =~ /--help/i) { print "install.pl - installs astGUIclient server files in the proper places, this\n"; - print "script will look for an /etc/astguiclient.conf file for existing settings, and\n"; + print "script will look for a configuration file for existing settings, and\n"; print "if not present will prompt for proper information then copy files.\n"; print "\n"; print "installation options:\n"; @@ -157,6 +159,7 @@ if (length($ARGV[0])>1) print " [--web-only] = only copy files/directories for web server install\n"; print " [--without-web] = do not copy web files/directories\n\n"; print "configuration options:\n"; + print " [--conffile=/path/from/root] = define configuration file path from root at runtime\n"; print " [--home=/path/from/root] = define home path from root at runtime\n"; print " [--logs=/path/from/root] = define logs path from root at runtime\n"; print " [--agi=/path/from/root] = define agi-bin path from root at runtime\n"; @@ -185,6 +188,7 @@ if (length($ARGV[0])>1) print " 9 - Timeclock auto-logout\n"; print " [--asterisk_version] = set the asterisk version you want to install for\n"; print " [--copy_sample_conf_files] = copies the sample conf files to /etc/asterisk/\n"; + print " [--web-languages] = copy language translations (WARNING! may not work on trunk installs)\n"; print " [--FTP_host=192.168.0.2] = define recording archive server IP address at runtime\n"; print " [--FTP_user=cron] = define archive server name at runtime\n"; print " [--FTP_pass=test] = define archive server user login at runtime\n"; @@ -223,6 +227,18 @@ if (length($ARGV[0])>1) {$NOWEB=0;} if ($args =~ /--no-prompt/i) # do not ask questions {$NOPROMPT=1;} + if ($args =~ /--conffile=/i) # CLI defined conffile path + { + @CLIconffileARY = split(/--conffile=/,$args); + @CLIconffileARX = split(/ /,$CLIconffileARY[1]); + if (length($CLIconffileARX[0])>2) + { + $PATHconf = $CLIconffileARX[0]; + $PATHconf =~ s/\/$| |\r|\n|\t//gi; + $CLIconffile=1; + print " CLI defined conffile path: $PATHconf\n"; + } + } if ($args =~ /--home=/i) # CLI defined home path { @CLIhomeARY = split(/--home=/,$args); @@ -570,6 +586,16 @@ if (length($ARGV[0])>1) $CLIcopy_conf_files='n'; } + if ($args =~ /--web-languages/i) # web languages flag + { + $CLIcopy_web_lang='y'; + print " CLI copy web lang files: YES\n"; + } + else + { + $CLIcopy_web_lang='n'; + } + if ($args =~ /--fastagi_log_min_servers=/i) # CLI defined fastagi min servers { @CLIDB_minserARY = split(/--fastagi_log_min_servers=/,$args); @@ -661,7 +687,7 @@ if (length($ARGV[0])>1) print " CLI multiserver conf gen: YES\n"; # default path to astguiclient configuration file: - $PATHconf = '/etc/astguiclient.conf'; + # $PATHconf = '/etc/astguiclient.conf'; open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; @conf = ; @@ -825,7 +851,7 @@ if (length($ARGV[0])>1) print " CLI phones conf gen: YES\n"; # default path to astguiclient configuration file: - $PATHconf = '/etc/astguiclient.conf'; + # $PATHconf = '/etc/astguiclient.conf'; open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; @conf = ; @@ -1058,6 +1084,111 @@ else while ($config_finished =~/NO/) { print "\nSTARTING ASTGUICLIENT MANUAL CONFIGURATION PHASE...\n"; + ##### BEGIN astguiclient conf file prompting and existence check ##### + $continue='NO'; + while ($continue =~/NO/) + { + print("\nastguiclient configuration file or press enter for default: [$PATHconf] "); + $PROMPTconf = ; + chomp($PROMPTconf); + if (length($PROMPTconf)>2) + { + $PROMPTconf =~ s/ |\n|\r|\t|\/$//gi; + $PATHconf=$PROMPTconf; + $continue='YES'; + } + else + { + $continue='YES'; + } + } + if (-e "$PATHconf") + { + print "Previous astGUIclient configuration file found at: $PATHconf\n"; + open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; + @conf = ; + close(conf); + $i=0; + foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^PATHDONEmonitor/) && ($CLIDONEmonitor < 1) ) + {$PATHDONEmonitor = $line; $PATHDONEmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_custom_user/) && ($CLIDB_custom_user < 1) ) + {$VARDB_custom_user = $line; $VARDB_custom_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_custom_pass/) && ($CLIDB_custom_pass < 1) ) + {$VARDB_custom_pass = $line; $VARDB_custom_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) ) + {$VARactive_keepalives = $line; $VARactive_keepalives =~ s/.*=//gi;} + if ( ($line =~ /^VARasterisk_version/) && ($CLIasterisk_version < 1) ) + {$VARasterisk_version = $line; $VARasterisk_version =~ s/.*=//gi;} + if ( ($line =~ /^VARFTP_host/) && ($CLIFTP_host < 1) ) + {$VARFTP_host = $line; $VARFTP_host =~ s/.*=//gi;} + if ( ($line =~ /^VARFTP_user/) && ($CLIFTP_user < 1) ) + {$VARFTP_user = $line; $VARFTP_user =~ s/.*=//gi;} + if ( ($line =~ /^VARFTP_pass/) && ($CLIFTP_pass < 1) ) + {$VARFTP_pass = $line; $VARFTP_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARFTP_port/) && ($CLIFTP_port < 1) ) + {$VARFTP_port = $line; $VARFTP_port =~ s/.*=//gi;} + if ( ($line =~ /^VARFTP_dir/) && ($CLIFTP_dir < 1) ) + {$VARFTP_dir = $line; $VARFTP_dir =~ s/.*=//gi;} + if ( ($line =~ /^VARHTTP_path/) && ($CLIHTTP_path < 1) ) + {$VARHTTP_path = $line; $VARHTTP_path =~ s/.*=//gi;} + if ( ($line =~ /^VARREPORT_host/) && ($CLIREPORT_host < 1) ) + {$VARREPORT_host = $line; $VARREPORT_host =~ s/.*=//gi;} + if ( ($line =~ /^VARREPORT_user/) && ($CLIREPORT_user < 1) ) + {$VARREPORT_user = $line; $VARREPORT_user =~ s/.*=//gi;} + if ( ($line =~ /^VARREPORT_pass/) && ($CLIREPORT_pass < 1) ) + {$VARREPORT_pass = $line; $VARREPORT_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARREPORT_port/) && ($CLIREPORT_port < 1) ) + {$VARREPORT_port = $line; $VARREPORT_port =~ s/.*=//gi;} + if ( ($line =~ /^VARREPORT_dir/) && ($CLIREPORT_dir < 1) ) + {$VARREPORT_dir = $line; $VARREPORT_dir =~ s/.*=//gi;} + if ( ($line =~ /^VARfastagi_log_min_servers/) && ($CLIVARfastagi_log_min_servers < 1) ) + {$VARfastagi_log_min_servers = $line; $VARfastagi_log_min_servers =~ s/.*=//gi;} + if ( ($line =~ /^VARfastagi_log_max_servers/) && ($CLIVARfastagi_log_max_servers < 1) ) + {$VARfastagi_log_max_servers = $line; $VARfastagi_log_max_servers =~ s/.*=//gi;} + if ( ($line =~ /^VARfastagi_log_min_spare_servers/) && ($CLIVARfastagi_log_min_spare_servers < 1) ) + {$VARfastagi_log_min_spare_servers = $line; $VARfastagi_log_min_spare_servers =~ s/.*=//gi;} + if ( ($line =~ /^VARfastagi_log_max_spare_servers/) && ($CLIVARfastagi_log_max_spare_servers < 1) ) + {$VARfastagi_log_max_spare_servers = $line; $VARfastagi_log_max_spare_servers =~ s/.*=//gi;} + if ( ($line =~ /^VARfastagi_log_max_requests/) && ($CLIVARfastagi_log_max_requests < 1) ) + {$VARfastagi_log_max_requests = $line; $VARfastagi_log_max_requests =~ s/.*=//gi;} + if ( ($line =~ /^VARfastagi_log_checkfordead/) && ($CLIVARfastagi_log_checkfordead < 1) ) + {$VARfastagi_log_checkfordead = $line; $VARfastagi_log_checkfordead =~ s/.*=//gi;} + if ( ($line =~ /^VARfastagi_log_checkforwait/) && ($CLIVARfastagi_log_checkforwait < 1) ) + {$VARfastagi_log_checkforwait = $line; $VARfastagi_log_checkforwait =~ s/.*=//gi;} + $i++; + } + } + ##### END astguiclient conf file prompting and existence check ##### + + ##### BEGIN astguiclient home directory prompting and existence check ##### $continue='NO'; while ($continue =~/NO/) @@ -1745,6 +1876,45 @@ else } ##### END copy asterisk sample conf files prompt ##### + ##### BEGIN copy web language translation files prompt ##### + $continue='NO'; + while ($continue =~/NO/) + { + print("\nCopy web language translation files to webroot ? [$CLIcopy_web_lang] "); + $PROMPTcopy_web_lang = ; + chomp($PROMPTcopy_web_lang); + if (length($PROMPTcopy_web_lang)<1) + {$PROMPTcopy_web_lang = $CLIcopy_web_lang;} + if ($PROMPTcopy_web_lang =~ /y/i) + { + if (!-e "$PATHweb") + { + print("$PATHweb does not exist, would you like me to create it?(y/n) [y] "); + $createPATHweb = ; + chomp($createPATHweb); + if ($createPATHweb =~ /n/i) + { + $continue='NO'; + } + else + { + `mkdir -p $PATHweb`; + print " $PATHweb directory created\n"; + $continue='YES'; + } + } + else + { + $continue='YES'; + } + } + else + { + $continue='YES'; + } + } + ##### END copy web language translation files prompt ##### + ##### BEGIN FTP_host prompting and check ##### if (length($VARFTP_host)<7) { @@ -2115,6 +2285,7 @@ else print "\n"; + print " defined conf file: $PATHconf\n"; print " defined home path: $PATHhome\n"; print " defined logs path: $PATHlogs\n"; print " defined agi-bin path: $PATHagi\n"; @@ -2133,6 +2304,7 @@ else print " defined active_keepalives: $VARactive_keepalives\n"; print " defined asterisk_version: $VARasterisk_version\n"; print " defined copying conf files: $PROMPTcopy_conf_files\n"; + print " defined copying weblang files: $PROMPTcopy_web_lang\n"; print " defined FTP_host: $VARFTP_host\n"; print " defined FTP_user: $VARFTP_user\n"; print " defined FTP_pass: $VARFTP_pass\n"; @@ -2163,10 +2335,10 @@ else } } -print "Writing to astguiclient.conf file: $PATHconf\n"; +print "Writing to configuration file: $PATHconf\n"; open(conf, ">$PATHconf") || die "can't open $PATHconf: $!\n"; -print conf "# astguiclient.conf - configuration elements for the astguiclient package\n"; +print conf "# $PATHconf - configuration elements for the astguiclient/vicidial package\n"; print conf "# this is the astguiclient configuration file \n"; print conf "# all comments will be lost if you run install.pl again\n"; print conf "\n"; @@ -2328,7 +2500,6 @@ if ($NOWEB < 1) print "Creating $PATHweb web directories...\n"; if (!-e "$PATHweb/agc/") {`mkdir -p $PATHweb/agc/`;} - if (!-e "$PATHweb/astguiclient/") {`mkdir -p $PATHweb/astguiclient/`;} if (!-e "$PATHweb/vicidial/") {`mkdir -p $PATHweb/vicidial/`;} if (!-e "$PATHweb/vicidial/ploticus/") {`mkdir -p $PATHweb/vicidial/ploticus/`;} if (!-e "$PATHweb/vicidial/agent_reports/") {`mkdir -p $PATHweb/vicidial/agent_reports/`;} @@ -2340,16 +2511,133 @@ if ($NOWEB < 1) print "setting web scripts to executable...\n"; `chmod 0777 $PATHweb/`; `chmod -R 0755 $PATHweb/agc/`; - `chmod -R 0755 $PATHweb/astguiclient/`; `chmod -R 0755 $PATHweb/vicidial/`; `chmod 0777 $PATHweb/agc/`; - `chmod 0777 $PATHweb/astguiclient/`; `chmod 0777 $PATHweb/vicidial/`; `chmod 0777 $PATHweb/vicidial/ploticus/`; `chmod 0777 $PATHweb/vicidial/agent_reports/`; `chmod 0777 $PATHweb/vicidial/server_reports/`; } +if ( ($PROMPTcopy_web_lang =~ /y/i) || ($CLIcopy_web_lang =~ /y/i) ) + { + print "Copying web language translation files to $PATHweb...\n"; + if (!-e "$PATHweb/agc_br/") {`mkdir -p $PATHweb/agc_br/`;} + if (!-e "$PATHweb/agc_de/") {`mkdir -p $PATHweb/agc_de/`;} + if (!-e "$PATHweb/agc_el/") {`mkdir -p $PATHweb/agc_el/`;} + if (!-e "$PATHweb/agc_en/") {`mkdir -p $PATHweb/agc_en/`;} + if (!-e "$PATHweb/agc_es/") {`mkdir -p $PATHweb/agc_es/`;} + if (!-e "$PATHweb/agc_fr/") {`mkdir -p $PATHweb/agc_fr/`;} + if (!-e "$PATHweb/agc_it/") {`mkdir -p $PATHweb/agc_it/`;} + if (!-e "$PATHweb/agc_nl/") {`mkdir -p $PATHweb/agc_nl/`;} + if (!-e "$PATHweb/agc_pl/") {`mkdir -p $PATHweb/agc_pl/`;} + if (!-e "$PATHweb/agc_pt/") {`mkdir -p $PATHweb/agc_pt/`;} + if (!-e "$PATHweb/agc_ru/") {`mkdir -p $PATHweb/agc_ru/`;} + if (!-e "$PATHweb/agc_se/") {`mkdir -p $PATHweb/agc_se/`;} + if (!-e "$PATHweb/agc_sk/") {`mkdir -p $PATHweb/agc_sk/`;} + if (!-e "$PATHweb/agc_tw/") {`mkdir -p $PATHweb/agc_tw/`;} + if (!-e "$PATHweb/vicidial_br/") {`mkdir -p $PATHweb/vicidial_br/`;} + if (!-e "$PATHweb/vicidial_de/") {`mkdir -p $PATHweb/vicidial_de/`;} + if (!-e "$PATHweb/vicidial_el/") {`mkdir -p $PATHweb/vicidial_el/`;} + if (!-e "$PATHweb/vicidial_en/") {`mkdir -p $PATHweb/vicidial_en/`;} + if (!-e "$PATHweb/vicidial_es/") {`mkdir -p $PATHweb/vicidial_es/`;} + if (!-e "$PATHweb/vicidial_fr/") {`mkdir -p $PATHweb/vicidial_fr/`;} + if (!-e "$PATHweb/vicidial_it/") {`mkdir -p $PATHweb/vicidial_it/`;} + + print "Copying web files...\n"; + `cp -f -R ./LANG_www/* $PATHweb/`; + + print "setting web lang scripts to executable...\n"; + `chmod 0777 $PATHweb/`; + `chmod -R 0755 $PATHweb/agc_br/`; + `chmod -R 0755 $PATHweb/agc_de/`; + `chmod -R 0755 $PATHweb/agc_el/`; + `chmod -R 0755 $PATHweb/agc_en/`; + `chmod -R 0755 $PATHweb/agc_es/`; + `chmod -R 0755 $PATHweb/agc_fr/`; + `chmod -R 0755 $PATHweb/agc_it/`; + `chmod -R 0755 $PATHweb/agc_nl/`; + `chmod -R 0755 $PATHweb/agc_pl/`; + `chmod -R 0755 $PATHweb/agc_pt/`; + `chmod -R 0755 $PATHweb/agc_ru/`; + `chmod -R 0755 $PATHweb/agc_se/`; + `chmod -R 0755 $PATHweb/agc_sk/`; + `chmod -R 0755 $PATHweb/agc_tw/`; + `chmod -R 0755 $PATHweb/vicidial_br/`; + `chmod -R 0755 $PATHweb/vicidial_de/`; + `chmod -R 0755 $PATHweb/vicidial_el/`; + `chmod -R 0755 $PATHweb/vicidial_en/`; + `chmod -R 0755 $PATHweb/vicidial_es/`; + `chmod -R 0755 $PATHweb/vicidial_fr/`; + `chmod -R 0755 $PATHweb/vicidial_it/`; + `chmod 0777 $PATHweb/agc_br/`; + `chmod 0777 $PATHweb/agc_de/`; + `chmod 0777 $PATHweb/agc_el/`; + `chmod 0777 $PATHweb/agc_en/`; + `chmod 0777 $PATHweb/agc_es/`; + `chmod 0777 $PATHweb/agc_fr/`; + `chmod 0777 $PATHweb/agc_it/`; + `chmod 0777 $PATHweb/agc_nl/`; + `chmod 0777 $PATHweb/agc_pl/`; + `chmod 0777 $PATHweb/agc_pt/`; + `chmod 0777 $PATHweb/agc_ru/`; + `chmod 0777 $PATHweb/agc_se/`; + `chmod 0777 $PATHweb/agc_sk/`; + `chmod 0777 $PATHweb/agc_tw/`; + `chmod 0777 $PATHweb/vicidial_br/`; + `chmod 0777 $PATHweb/vicidial_de/`; + `chmod 0777 $PATHweb/vicidial_el/`; + `chmod 0777 $PATHweb/vicidial_en/`; + `chmod 0777 $PATHweb/vicidial_es/`; + `chmod 0777 $PATHweb/vicidial_fr/`; + `chmod 0777 $PATHweb/vicidial_it/`; + } + +if ($PATHconf !~ /\/etc\/astguiclient.conf/) + { + print "Using non-default conf file, adjusting hard-coded paths...\n"; + + $PATHconfEREG = $PATHconf; + $PATHconfEREG =~ s/\//\\\//gi; + $PATHconfDEFAULT = $defaultPATHconf; + $PATHconfDEFAULT =~ s/\//\\\//gi; +# print "$PATHconfEREG\n$PATHconfDEFAULT\n"; + + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHhome/* `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHagi/* `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial/listloader.pl `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial/listloader_super.pl `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial/listloader_rowdisplay.pl `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial/spreadsheet_sales_viewer.pl `; + + if ( ($PROMPTcopy_web_lang =~ /y/i) || ($CLIcopy_web_lang =~ /y/i) ) + { + print "Adjusting hard-coded paths in web language translation files...\n"; + + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_br/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_de/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_el/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_es/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_fr/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_it/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_nl/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_pl/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_pt/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_ru/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_se/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_sk/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/agc_tw/dbconnect.php `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial_br/* `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial_de/* `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial_el/* `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial_es/* `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial_fr/* `; + `sed -i 's/$PATHconfDEFAULT/$PATHconfEREG/g' $PATHweb/vicidial_it/* `; + } + } + if ( ($PROMPTcopy_conf_files =~ /y/i) || ($CLIcopy_conf_files =~ /y/i) ) { print "Copying sample conf files to /etc/asterisk/...\n"; @@ -2399,7 +2687,7 @@ if( $VARserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ ) # print "exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; # print "exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; -print "\nASTGUICLIENT INSTALLATION FINISHED! ENJOY!\n"; +print "\nASTGUICLIENT VICIDIAL INSTALLATION FINISHED! ENJOY!\n"; $secy = time(); $secz = ($secy - $secX); $minz = ($secz/60); # calculate script runtime so far print "\n - process runtime ($secz sec) ($minz minutes)\n";