diff --git a/agc_2-X/trunk/INSTALL b/agc_2-X/trunk/INSTALL index 346847af..c17ab646 100644 --- a/agc_2-X/trunk/INSTALL +++ b/agc_2-X/trunk/INSTALL @@ -1,7 +1,13 @@ ################ INSTALL -Short installation instructions for astGUIclient 2.0 tree will go here. +For in-depth installation instructions read the docs/SCRATCH_INSTALL.txt file +For more brief install instructions read the docs/BASE_INSTALL.txt file + +For Requirements of astGUIclient/VICIDIAL read the docs/REQUIREMENTS.txt file + + +To place the astGUIclient/VICIDIAL files where they belong on the server: run the install.pl script from this directory: perl install.pl diff --git a/agc_2-X/trunk/LANG_www/agc/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc/active_list_refresh.php index dd977642..7ea0bff0 100644 --- a/agc_2-X/trunk/LANG_www/agc/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc/astguiclient.php b/agc_2-X/trunk/LANG_www/agc/astguiclient.php index e6abfad0..c5fe5902 100644 --- a/agc_2-X/trunk/LANG_www/agc/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ $agcDIR = eregi_replace('astguiclient.php','',$agcDIR); $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/agc/calendar.php b/agc_2-X/trunk/LANG_www/agc/calendar.php deleted file mode 100644 index e4068019..00000000 --- a/agc_2-X/trunk/LANG_www/agc/calendar.php +++ /dev/null @@ -1,125 +0,0 @@ -"; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; - -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= ""; - -echo "$CCAL_OUT\n"; - diff --git a/agc_2-X/trunk/LANG_www/agc/call_log_display.php b/agc_2-X/trunk/LANG_www/agc/call_log_display.php index 4abec74d..28d3ea87 100644 --- a/agc_2-X/trunk/LANG_www/agc/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc/conf_exten_check.php index 1f93e8ec..8915d813 100644 --- a/agc_2-X/trunk/LANG_www/agc/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc/dbconnect.php b/agc_2-X/trunk/LANG_www/agc/dbconnect.php index 1662f18f..7221b35e 100644 --- a/agc_2-X/trunk/LANG_www/agc/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/agc/dbconnect.php @@ -1,15 +1,48 @@ LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; - -$WeBServeRRooT = '/usr/local/apache2/htdocs'; $WeBRooTWritablE = '1'; ?> diff --git a/agc_2-X/trunk/LANG_www/agc/fix-dispo-list.patch b/agc_2-X/trunk/LANG_www/agc/fix-dispo-list.patch deleted file mode 100644 index f3cca9ef..00000000 --- a/agc_2-X/trunk/LANG_www/agc/fix-dispo-list.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- /usr/src/astguiclient_snapshot_2006-04-10/VICIDIAL_web/admin.php 2006-02-27 15:58:50.000000000 -0800 -+++ /var/www/html/vicidial/admin.php 2006-04-10 23:12:19.000000000 -0700 -@@ -3320,15 +3320,38 @@ - $o=0; - while ($statuses_to_print > $o) - { -- $rowx=mysql_fetch_row($rsltx); -- $leads_in_list = ($leads_in_list + $rowx[2]); -+ $rowx=mysql_fetch_row($rsltx); -+ -+ $lead_list['count'] = ($lead_list['count'] + $rowx[2]); -+ if ($rowx[1] == 'N') -+ { -+ $since_reset = 'N'; -+ $since_resetX = 'Y'; -+ } -+ else -+ { -+ $since_reset = 'Y'; -+ $since_resetX = 'N'; -+ } -+ $lead_list[$since_reset][$rowx[0]] = $rowx[2]; -+ $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); -+ #If opposite side is not set, it may not in the future so give it a value of zero -+ if (!isset($lead_list[$since_resetX][$rowx[0]])) -+ { -+ $lead_list[$since_resetX][$rowx[0]]=0; -+ } -+ $o++; -+ } - -+ $o=0; -+ while (list($dispo,) = each($lead_list[$since_reset])) -+ { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - -- if ($rowx[0] == 'CBHOLD') -+ if ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; -@@ -3338,24 +3361,12 @@ - $CLB=''; - $CLE=''; - } -- -- if ($rowx[1] == 'N') -- { -- $leads_in_list_N = ($leads_in_list_N + $rowx[2]); -- echo "$CLB$rowx[0]$CLE $rowx[2]\n"; -- } -- else -- { -- $leads_in_list_Y = ($leads_in_list_Y + $rowx[2]); -- echo "$CLB$rowx[0]$CLE$rowx[2] \n"; -- -- } -- -- $o++; -+ echo "$CLB$dispo$CLE".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]." \n"; -+ $o++; - } - --echo "SUBTOTALS$leads_in_list_Y$leads_in_list_N\n"; --echo "TOTAL$leads_in_list\n"; -+echo "SUBTOTALS$lead_list[Y_count]$lead_list[N_count]\n"; -+echo "TOTAL$lead_list[count]\n"; - - echo "
\n"; - diff --git a/agc_2-X/trunk/LANG_www/agc/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc/inbound_popup.php index e26c4496..c92583de 100644 --- a/agc_2-X/trunk/LANG_www/agc/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc/live_exten_check.php index e0ca96c8..3dadf572 100644 --- a/agc_2-X/trunk/LANG_www/agc/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $ChannelA[$loop_count] = "$row[0]"; - $ChannelB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $ChannelA[$counter]|"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; + echo "ChannelBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc/manager_send.php b/agc_2-X/trunk/LANG_www/agc/manager_send.php index b934cbb8..5bfe93f1 100644 --- a/agc_2-X/trunk/LANG_www/agc/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "One of these variables is not valid:\n"; + echo "Channel $channel must be greater than 2 characters\n"; + echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; + echo "queryCID $queryCID must be greater than 14 characters\n"; + echo "exten $exten must be set\n"; + echo "ext_context $ext_context must be set\n"; + echo "ext_priority $ext_priority must be set\n"; + echo "\nRedirect Action not sent\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect command not inserted\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX command sent for Channel $channel on $call_server_ip and \nHungup $extrachannel on $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc/park_calls_display.php index 246591b1..872f5780 100644 --- a/agc_2-X/trunk/LANG_www/agc/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc/vdc_db_query.php index 40f6a5c5..866c0584 100644 --- a/agc_2-X/trunk/LANG_www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Campaign $campaign is not valid\n"; + echo "lead_id $lead_id is not valid\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If CALLBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation on the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc/vicidial.php b/agc_2-X/trunk/LANG_www/agc/vicidial.php index 7d6acae2..eeae3178 100644 --- a/agc_2-X/trunk/LANG_www/agc/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of seconds for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign name on login pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DST on server for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ if ($user_login_first == 1) #echo "\n"; #echo "\n"; echo "

User Login

"; - echo "
Re-Login
"; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ if ($user_login_first == 1) echo "
Campaign Login
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "
Login
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "Login incorrect, please try again
"; } @@ -616,7 +647,7 @@ $VDloginDISPLAY=0; echo "\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo "
Phone Login
"; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n"; - echo "


Campaign Login
"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,7 +1380,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Resume\""; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CXFER","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("AXFER","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1849,7 +1923,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Stop"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Start"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { @@ -1857,7 +1939,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Start"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Start"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("AXFER","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CXFER","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2136,7 +2250,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { var conf_rec_start_html = "\"Start"; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Start"; } @@ -2527,6 +2641,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; + all_record_count=0; document.getElementById("DiaLControl").innerHTML = "\"Dial"; if (document.vicidial_form.LeadPreview.checked==true) { @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; // $VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2698,7 +2814,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Hangup"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTPhoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2903,7 +3020,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Hangup"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("Channel has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3213,7 +3395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Start"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_seconds > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -5073,7 +5263,7 @@ echo "\n"; - + @@ -5336,7 +5526,7 @@ RECORD ID:

Hangup Customer

-Send DTMF
+Send DTMF
@@ -5372,7 +5562,7 @@ RECORD ID:
- + diff --git a/agc_2-X/trunk/LANG_www/agc/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc/voicemail_check.php index 9cc655c6..0aa152d7 100644 --- a/agc_2-X/trunk/LANG_www/agc/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_br/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_br/active_list_refresh.php index 1f1e784a..61d75d5d 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_br/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_br/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_br/astguiclient.php index 4526eb81..1fe0f403 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_br/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo "\n";echo "\n";echo "
Login Error
  (This is usually a 1 in the USA-Canada)
Phone Number:   (10 digits max - digits only)  (12 digits max - digits only)
Search Existing Leads:   (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)   Vendor ID:
Phone:   DialCode:   Alt. Phone:   DialCode:   Alt. Phone:
Show:   Email: 0) + { + fwrite ($fp, "VICIDISCAR|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDISCAR|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDISCAR|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/agc_br/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_br/call_log_display.php index 11771e35..abbaabeb 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_br/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_br/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_br/conf_exten_check.php index ac0d543b..bde2a809 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_br/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_br/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_br/inbound_popup.php index 089e809f..d75c9b5b 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_br/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_br/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_br/live_exten_check.php index 845ae60c..7e9fcba6 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_br/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $CanalA[$loop_count] = "$row[0]"; - $CanalB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; + echo "CanalA: $ChanneLA[$counter] ~"; + echo "CanalB: $ChanneLB[$counter] ~"; echo "CanalBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; + echo "CanalA: $ChanneLA[$counter] ~"; + echo "CanalB: $ChanneLB[$counter] ~"; echo "CanalBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; + echo "CanalA: $ChanneLA[$counter] ~"; + echo "CanalB: $ChanneLB[$counter] ~"; echo "CanalBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; + echo "CanalA: $ChanneLA[$counter] ~"; + echo "CanalB: $ChanneLB[$counter] ~"; echo "CanalBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $CanalA[$counter]|"; + echo "CanalA: $ChanneLA[$counter] ~"; + echo "CanalB: $ChanneLB[$counter] ~"; + echo "CanalBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_br/manager_send.php b/agc_2-X/trunk/LANG_www/agc_br/manager_send.php index 7a23c861..4eb878bd 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_br/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Uma dessas variáveis não é válido:\n"; + echo "Canal $channel Deve ser maior que 2 caracteres\n"; + echo "ExtraCanal $extrachannel Deve ser maior que 2 caracteres\n"; + echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; + echo "exten $exten Deve ser definido\n"; + echo "ext_context $ext_context Deve ser definido\n"; + echo "ext_priority $ext_priority Deve ser definido\n"; + echo "\nRedirect Action não enviado\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel não está ativoligado$call_server_ip, Redirect comando não inserido\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel não está ativoligado$server_ip, Redirect comando não inserido\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect comando não inserido\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX comando enviado para Canal $channelligado$call_server_ip and \nHungup $extrachannelligado$server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_br/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_br/park_calls_display.php index 8b4310da..d9682d85 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_br/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_br/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_br/vdc_db_query.php index 9290c1eb..7434f620 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_br/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Campanha $campaign não é válido\n"; + echo "lead_id $lead_id não é válido\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If CHAMADABK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHVELHO", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservationligadothe vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservationligadothe vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc_br/vicidial.php b/agc_2-X/trunk/LANG_www/agc_br/vicidial.php index 0da1fd2b..bd8b9e9e 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_br/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign nameligadologin pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DSTligadoserver for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "English Brazil
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ echo "
Re-Login
\n"; #echo "\n"; echo "

Login do Usuário

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ echo "\n";echo "\n"; echo "
Login da Campanha
English Brazil
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "\n";echo "\n";echo "
Login
English Brazil
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "Usuário incorreto, por favor tente novamente
"; } @@ -616,7 +647,7 @@ echo "
Login do Telefone
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ echo "\n";echo "\n";echo "
Login da Campanha
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1000,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Janeiro','February','Março','Abril','Pode','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,7 +1380,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; var DiaLControl_auto_HTML = "\"Pausa\"\"Início\""; var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Início\""; var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Início\""; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("TRANFERENCIA","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CTRANFERENCIA","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("ATRANFERENCIA","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1849,7 +1923,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Parar"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Inicia"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { @@ -1857,7 +1939,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Inicia"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Inicia"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("TRANFERENCIA","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("ATRANFERENCIA","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CTRANFERENCIA","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2136,7 +2250,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { var conf_rec_start_html = "\"Inicia"; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Inicia"; } @@ -2527,6 +2641,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; + all_record_count=0; document.getElementById("DiaLControl").innerHTML = "\"Discar"; if (document.vicidial_form.LeadPreview.checked==true) { @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICIDISCAR_web_QUERY_STRING =~ s/ /+/gi; // $VICIDISCAR_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2698,7 +2814,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Desligar"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTTelefoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2903,7 +3020,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Desligar"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("Canal has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3213,7 +3395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Inicia"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_segundos > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -5073,7 +5263,7 @@ echo "\n"; - + @@ -5336,7 +5526,7 @@ ID da gravação:

Desligar Cliente

-Enviar DTMF
+Enviar DTMF
@@ -5372,7 +5562,7 @@ ID da gravação:
  ID do Vendedor: - + diff --git a/agc_2-X/trunk/LANG_www/agc_br/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_br/voicemail_check.php index 40f2fc42..628f19b0 100644 --- a/agc_2-X/trunk/LANG_www/agc_br/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_br/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_de/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_de/active_list_refresh.php index 586890cb..4b0ed08b 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_de/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_de/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_de/astguiclient.php index 98164516..2a1119ac 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_de/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo " - - - - - + + + + +
Login Error
  (Normalmente é 1 nos EUA-Canada)
Telefone Number:   (Maximo de 10 digitos - apenas número)  (12 digits max - digits only)
Ligações Existentes Da Busca:   (Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova)
Telefone:   Codigo de Area:   Telefone Alternativo:   Codigo de Area:   Telefone Alternativo:
Mostrar:   Email: 0) + { + fwrite ($fp, "VICIVORWAHLKNOPF|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIVORWAHLKNOPF|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIVORWAHLKNOPF|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } @@ -484,15 +490,15 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var phone_pass = ''; var session_name = ''; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_de.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_de.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_voicemail_OFF = new Image(); - image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF_de.gif"; + image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF.gif"; var image_voicemail_ON = new Image(); - image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON_de.gif"; + image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON.gif"; var image_voicemail_BLINK = new Image(); - image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK_de.gif"; + image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK.gif"; var favorites = new Array(); var favorites_names = new Array(); var favorites_busy = new Array(); @@ -2713,11 +2719,11 @@ echo "\n"; LOGOUT
\n"; ?>
HauptverkleidungAktive Linien VerkleidungKonferenz-VerkleidungÜberprüfen Sie VoicemailLeben AnrufHauptverkleidungAktive Linien VerkleidungKonferenz-VerkleidungÜberprüfen Sie VoicemailLeben Anruf
diff --git a/agc_2-X/trunk/LANG_www/agc_de/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_de/call_log_display.php index ed6d8f68..a08018fd 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_de/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_de/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_de/conf_exten_check.php index de56646a..b58cff5a 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_de/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_de/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_de/inbound_popup.php index f4058509..42baa313 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_de/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_de/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_de/live_exten_check.php index 4c60b701..8f3a20f5 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_de/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $FührungA[$loop_count] = "$row[0]"; - $FührungB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; + echo "FührungA: $ChanneLA[$counter] ~"; + echo "FührungB: $ChanneLB[$counter] ~"; echo "FührungBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; + echo "FührungA: $ChanneLA[$counter] ~"; + echo "FührungB: $ChanneLB[$counter] ~"; echo "FührungBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; + echo "FührungA: $ChanneLA[$counter] ~"; + echo "FührungB: $ChanneLB[$counter] ~"; echo "FührungBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; + echo "FührungA: $ChanneLA[$counter] ~"; + echo "FührungB: $ChanneLB[$counter] ~"; echo "FührungBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $FührungA[$counter]|"; + echo "FührungA: $ChanneLA[$counter] ~"; + echo "FührungB: $ChanneLB[$counter] ~"; + echo "FührungBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_de/manager_send.php b/agc_2-X/trunk/LANG_www/agc_de/manager_send.php index 4564dadd..304b3851 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_de/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Eine dieser Variablen ist unzulässig:\n"; + echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; + echo "ExtraFührung $extrachannel muß als 2 Buchstaben grösser sein\n"; + echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; + echo "exten $exten muß eingestellt werden\n"; + echo "ext_context $ext_context muß eingestellt werden\n"; + echo "ext_priority $ext_priority muß eingestellt werden\n"; + echo "\nRedirect Action nicht gesendet\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Führung $channel ist nicht Phasen auf $call_server_ip, Redirect Befehl nicht eingesetzt\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Führung $channel ist nicht Phasen auf $server_ip, Redirect Befehl nicht eingesetzt\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect Befehl nicht eingesetzt\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX Befehl gesendet für Führung $channel auf $call_server_ip and \nHungup $extrachannel auf $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_de/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_de/park_calls_display.php index 07057230..fbcbde98 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_de/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_de/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_de/vdc_db_query.php index bf69e203..338e3f7c 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_de/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Kampagne $campaign ist unzulässig\n"; + echo "lead_id $lead_id ist unzulässig\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If ANRUFBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHALT", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservation auf the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation auf the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc_de/vicidial.php b/agc_2-X/trunk/LANG_www/agc_de/vicidial.php index 0e804c86..f67745c4 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_de/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of Sekunden for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign name auf login pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DST auf server for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "
English Deutsch
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ echo "
Re-LOGON
\n"; #echo "\n"; echo "

Benutzer-LOGON

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ echo "\n";echo "\n"; echo "
Kampagne LOGON
English Deutsch
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "\n";echo "\n";echo "
LOGON
English Deutsch
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "Der falsche LOGON, versuchen bitte noch einmal
"; } @@ -616,7 +647,7 @@ echo "
Telefon-LOGON
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ echo " - + @@ -5102,28 +5292,28 @@ Ihr Status:
Calls Dialing: @@ -5308,7 +5498,7 @@ Ihr Status:
Calls Dialing: @@ -5372,7 +5562,7 @@ SATZ IDENTIFIKATION: - + @@ -5400,7 +5590,7 @@ else
Kampagne LOGON
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1000,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Januar','February','März','April','Mag','Juni', + 'Juli','August','September','Oktober','November','Dezember'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,61 +1380,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' - var DiaLControl_auto_HTML = "\"Pause\"\"Zusammenfassung\""; - var DiaLControl_auto_HTML_ready = "\"Pause\"\"Zusammenfassung\""; - var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Zusammenfassung\""; - var DiaLControl_manual_HTML = "\"Vorwahlknopf-Folgende"; + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; + var DiaLControl_auto_HTML = "\"Pause\"\"Zusammenfassung\""; + var DiaLControl_auto_HTML_ready = "\"Pause\"\"Zusammenfassung\""; + var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Zusammenfassung\""; + var DiaLControl_manual_HTML = "\"Vorwahlknopf-Folgende"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_de.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_de.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_LB_dialnextnumber = new Image(); - image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber_de.gif"; + image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber.gif"; var image_LB_hangupcustomer = new Image(); - image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer_de.gif"; + image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer.gif"; var image_LB_transferconf = new Image(); - image_LB_transferconf.src="../agc/images/vdc_LB_transferconf_de.gif"; + image_LB_transferconf.src="../agc/images/vdc_LB_transferconf.gif"; var image_LB_grabparkedcall = new Image(); - image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall_de.gif"; + image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall.gif"; var image_LB_parkcall = new Image(); - image_LB_parkcall.src="../agc/images/vdc_LB_parkcall_de.gif"; + image_LB_parkcall.src="../agc/images/vdc_LB_parkcall.gif"; var image_LB_webform = new Image(); - image_LB_webform.src="../agc/images/vdc_LB_webform_de.gif"; + image_LB_webform.src="../agc/images/vdc_LB_webform.gif"; var image_LB_stoprecording = new Image(); - image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording_de.gif"; + image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording.gif"; var image_LB_startrecording = new Image(); - image_LB_startrecording.src="../agc/images/vdc_LB_startrecording_de.gif"; + image_LB_startrecording.src="../agc/images/vdc_LB_startrecording.gif"; var image_LB_pause = new Image(); - image_LB_pause.src="../agc/images/vdc_LB_pause_de.gif"; + image_LB_pause.src="../agc/images/vdc_LB_pause.gif"; var image_LB_resume = new Image(); - image_LB_resume.src="../agc/images/vdc_LB_resume_de.gif"; + image_LB_resume.src="../agc/images/vdc_LB_resume.gif"; var image_LB_senddtmf = new Image(); - image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf_de.gif"; + image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf.gif"; var image_LB_dialnextnumber_OFF = new Image(); - image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF_de.gif"; + image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF.gif"; var image_LB_hangupcustomer_OFF = new Image(); - image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF_de.gif"; + image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF.gif"; var image_LB_transferconf_OFF = new Image(); - image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF_de.gif"; + image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF.gif"; var image_LB_grabparkedcall_OFF = new Image(); image_LB_grabparkedcall_OFF.src="../agc/images/vdc_LB_grabparkedcall_OFF.gif"; var image_LB_parkcall_OFF = new Image(); - image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF_de.gif"; + image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF.gif"; var image_LB_webform_OFF = new Image(); - image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF_de.gif"; + image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF.gif"; var image_LB_stoprecording_OFF = new Image(); image_LB_stoprecording_OFF.src="../agc/images/vdc_LB_stoprecording_OFF.gif"; var image_LB_startrecording_OFF = new Image(); image_LB_startrecording_OFF.src="../agc/images/vdc_LB_startrecording_OFF.gif"; var image_LB_pause_OFF = new Image(); - image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF_de.gif"; + image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF.gif"; var image_LB_resume_OFF = new Image(); - image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF_de.gif"; + image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF.gif"; var image_LB_senddtmf_OFF = new Image(); - image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF_de.gif"; + image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF.gif"; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CXFER","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("AXFER","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1572,7 +1646,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; XDcheck = 'YES'; - // document.getElementById("HangupXferLine").innerHTML ="\"Hängezustand"; + // document.getElementById("HangupXferLine").innerHTML ="\"Hängezustand"; } } } @@ -1848,16 +1922,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // filename = filedate + "_" + user_abb; var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Stoppen"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Stoppen"; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Fangen"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { filename = taskconffile; var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Fangen"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Fangen"; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Fangen"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("AXFER","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CXFER","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2006,7 +2120,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var parkedby = protocol + "/" + extension; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; - document.getElementById("ParkControl").innerHTML ="\"Zupacken"; + document.getElementById("ParkControl").innerHTML ="\"Zupacken"; customerparked=1; } if (taskvar == 'FROMParK') @@ -2027,7 +2141,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; - document.getElementById("ParkControl").innerHTML ="\"Park-Anruf\""; + document.getElementById("ParkControl").innerHTML ="\"Park-Anruf\""; customerparked=0; } @@ -2135,8 +2249,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // alert("VICIVORWAHLKNOPF Call log entered:\n" + document.vicidial_form.uniqueid.value); if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { - var conf_rec_start_html = "\"Fangen"; - if (campaign_recording == 'NEVER') + var conf_rec_start_html = "\"Fangen"; + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Fangen"; } @@ -2447,15 +2561,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Angerufene 3. Partei: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"ANRUF"; + document.getElementById("Leave3WayCall").innerHTML ="\"ANRUF"; - document.getElementById("DialWithCustomer").innerHTML ="\"Vorwahlknopf"; + document.getElementById("DialWithCustomer").innerHTML ="\"Vorwahlknopf"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park-Kunde"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Park-Kunde"; - document.getElementById("HangupXferLine").innerHTML ="\"Hängezustand"; + document.getElementById("HangupXferLine").innerHTML ="\"Hängezustand"; - document.getElementById("HangupBothLines").innerHTML ="\"Hängezustand"; + document.getElementById("HangupBothLines").innerHTML ="\"Hängezustand"; xferchannellive=1; XDcheck = ''; @@ -2486,17 +2600,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=0; document.getElementById("MainStatuSSpan").innerHTML = " Benannt: " + lead_dial_number + " UID: " + CIDcheck + "  "; - document.getElementById("ParkControl").innerHTML ="\"Park-Anruf\""; + document.getElementById("ParkControl").innerHTML ="\"Park-Anruf\""; - document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; + document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; - document.getElementById("XferControl").innerHTML = "\"Übertragung"; + document.getElementById("XferControl").innerHTML = "\"Übertragung"; - document.getElementById("LocalCloser").innerHTML = "\"EINHEIMISCHER"; + document.getElementById("LocalCloser").innerHTML = "\"EINHEIMISCHER"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNES"; + document.getElementById("InternalCloser").innerHTML = "\"INTERNES"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Vorwahlknopf-Vorhang-Übertragung\""; + document.getElementById("DialBlindTransfer").innerHTML = "\"Vorwahlknopf-Vorhang-Übertragung\""; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -2527,7 +2641,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; - document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; + all_record_count=0; + document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICIVORWAHLKNOPF_web_QUERY_STRING =~ s/ /+/gi; // $VICIVORWAHLKNOPF_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2688,7 +2804,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; if (document.vicidial_form.LeadPreview.checked==false) { @@ -2696,9 +2812,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; + document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2745,7 +2861,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; + document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; var xmlhttp=false; /*@cc_on @*/ @@ -2822,7 +2938,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go auf to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; + document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; } } } @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTTelefonE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2901,9 +3018,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Benennen: " + manDiaLonly_num + " UID: " + MDnextCID + "   Wartering..."; - document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; + document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("Führung has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3132,17 +3313,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Ankommend: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } - document.getElementById("ParkControl").innerHTML ="\"Park-Anruf\""; + document.getElementById("ParkControl").innerHTML ="\"Park-Anruf\""; - document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; + document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; - document.getElementById("XferControl").innerHTML = "\"Übertragung"; + document.getElementById("XferControl").innerHTML = "\"Übertragung"; - document.getElementById("LocalCloser").innerHTML = "\"EINHEIMISCHER"; + document.getElementById("LocalCloser").innerHTML = "\"EINHEIMISCHER"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNES"; + document.getElementById("InternalCloser").innerHTML = "\"INTERNES"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Vorwahlknopf-Vorhang-Übertragung\""; + document.getElementById("DialBlindTransfer").innerHTML = "\"Vorwahlknopf-Vorhang-Übertragung\""; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3211,9 +3393,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3320,11 +3503,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\"\n"; } } @@ -3479,13 +3662,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip=''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\""; - document.getElementById("ParkControl").innerHTML = "\"Park-Anruf\""; - document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; - document.getElementById("XferControl").innerHTML = "\"Übertragung"; - document.getElementById("LocalCloser").innerHTML = "\"EINHEIMISCHER"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNES"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Vorwahlknopf-Vorhang-Übertragung\""; + document.getElementById("WebFormSpan").innerHTML = "\"Netz-Form\""; + document.getElementById("ParkControl").innerHTML = "\"Park-Anruf\""; + document.getElementById("HangupControl").innerHTML = "\"Hängezustand-Kunde\""; + document.getElementById("XferControl").innerHTML = "\"Übertragung"; + document.getElementById("LocalCloser").innerHTML = "\"EINHEIMISCHER"; + document.getElementById("InternalCloser").innerHTML = "\"INTERNES"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Vorwahlknopf-Vorhang-Übertragung\""; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.vicidial_form.custdatetime.value = ''; @@ -3498,7 +3681,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; + document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; reselect_alt_dial = 0; } } @@ -3591,15 +3774,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"ANRUF"; + document.getElementById("Leave3WayCall").innerHTML ="\"ANRUF"; - document.getElementById("DialWithCustomer").innerHTML ="\"Vorwahlknopf"; + document.getElementById("DialWithCustomer").innerHTML ="\"Vorwahlknopf"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park-Kunde"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Park-Kunde"; - document.getElementById("HangupXferLine").innerHTML ="\"Hängezustand"; + document.getElementById("HangupXferLine").innerHTML ="\"Hängezustand"; - document.getElementById("HangupBothLines").innerHTML ="\"Hängezustand"; + document.getElementById("HangupBothLines").innerHTML ="\"Hängezustand"; } } @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Fangen"; } @@ -4531,7 +4714,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; + document.getElementById("DiaLControl").innerHTML = "\"Vorwahlknopf-Folgende"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_Sekunden > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -4893,13 +5083,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('HotKeyEntriesBox'); hot_keys_active = 1; - document.getElementById("hotkeysdisplay").innerHTML = "\"HEISSE"; + document.getElementById("hotkeysdisplay").innerHTML = "\"HEISSE"; } else { hideDiv('HotKeyEntriesBox'); hot_keys_active = 0; - document.getElementById("hotkeysdisplay").innerHTML = "\"HEISSE"; + document.getElementById("hotkeysdisplay").innerHTML = "\"HEISSE"; } } @@ -4911,7 +5101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { HKbutton_allowed = 0; showDiv('TransferMain'); - document.getElementById("XferControl").innerHTML = "\"Übertragung"; + document.getElementById("XferControl").innerHTML = "\"Übertragung"; } else { @@ -4919,7 +5109,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('TransferMain'); if (showoffvar == 'YES') { - document.getElementById("XferControl").innerHTML = "\"Übertragung"; + document.getElementById("XferControl").innerHTML = "\"Übertragung"; } } } @@ -5029,7 +5219,7 @@ echo "\n"; - +
LOGON Error
VICIVORWAHLKNOPF SCRIPT   LIVE     Lernabschnitt ID: Leben AnrufLeben Anruf
@@ -5073,7 +5263,7 @@ echo "\n";
  (Dieses ist normalerweise 1 in den USA und im Kanada)
Telefon Number:   (10 Stellen Maximum - nur Stellen)  (12 digits max - digits only)
Suche existierende Anschlüsse:   (Wenn diese Option gesetzt ist wird versucht, die Telefonnummer im System zu finden, bevor sie als neuer Anschluss eingefügt wird)
- Übertragung - Konferenz
- INTERNES GENAUERES - EINHEIMISCHER GENAUER + Übertragung - Konferenz
+ INTERNES GENAUERES + EINHEIMISCHER GENAUER CODE - Hängezustand Xfer Linie - Hängezustand Beide Linien + Hängezustand Xfer Linie + Hängezustand Beide Linien
- Zahl zum zu benennen   - Sekunden   - channel + Zahl zum zu benennen   + Sekunden   + channel OVERRIDE   D1 D2
- Vorwahlknopf Mit Kunden - Park-Kunde Vorwahlknopf - ANRUF DES URLAUB-3-WAY - Vorwahlknopf-Vorhang-Übertragung + Vorwahlknopf Mit Kunden + Park-Kunde Vorwahlknopf + ANRUF DES URLAUB-3-WAY + Vorwahlknopf-Vorhang-Übertragung Blind Transfer VMail Message
-Vorwahlknopf-Folgende Zahl
+Vorwahlknopf-Folgende Zahl
LEITUNG VORBETRACHTUNG
WECH TELEFON
@@ -5327,16 +5517,16 @@ REGISTERAKTE:
SATZ IDENTIFIKATION:
-Fangen Sie an Zu notieren
+Fangen Sie an Zu notieren

-Netz-Form
+Netz-Form

-Park-Anruf
-Übertragung - Konferenz
+Park-Anruf
+Übertragung - Konferenz

-Hängezustand-Kunde
+Hängezustand-Kunde

-Senden Sie DTMF
+Senden Sie DTMF
  Verkäufer Identifikation:
Telefon:   DialCode:   Wech Telefon:   DialCode:   Wech Telefon:
Erscheinen:   Email:
diff --git a/agc_2-X/trunk/LANG_www/agc_de/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_de/voicemail_check.php index b872f19a..c3e994b8 100644 --- a/agc_2-X/trunk/LANG_www/agc_de/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_de/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_el/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_el/active_list_refresh.php index befdb32b..2de39cae 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_el/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_el/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_el/astguiclient.php index 2e48a6cc..d6fb7168 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_el/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo "\n";echo "\n";echo "
VICIVORWAHLKNOPF Netz-Klient Version:     BAU:               Bediener:              
Zeigen Sie Konferenzanruf-Führung Informationen
0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HEISSE SCHLÜSSEL UNAKTIVIERT +HEISSE SCHLÜSSEL UNAKTIVIERT
0) + { + fwrite ($fp, "VICIΚΛΗΣΗ|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIΚΛΗΣΗ|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIΚΛΗΣΗ|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/agc_el/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_el/call_log_display.php index 2b8304b0..d6f4ea88 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_el/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_el/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_el/conf_exten_check.php index 28b806da..fe4f464b 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_el/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_el/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_el/inbound_popup.php index 564999e3..fd8c7ba5 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_el/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_el/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_el/live_exten_check.php index e07c3cad..ad511dc2 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_el/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $ΚανάλιA[$loop_count] = "$row[0]"; - $ΚανάλιB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; + echo "ΚανάλιA: $ChanneLA[$counter] ~"; + echo "ΚανάλιB: $ChanneLB[$counter] ~"; echo "ΚανάλιBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; + echo "ΚανάλιA: $ChanneLA[$counter] ~"; + echo "ΚανάλιB: $ChanneLB[$counter] ~"; echo "ΚανάλιBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; + echo "ΚανάλιA: $ChanneLA[$counter] ~"; + echo "ΚανάλιB: $ChanneLB[$counter] ~"; echo "ΚανάλιBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; + echo "ΚανάλιA: $ChanneLA[$counter] ~"; + echo "ΚανάλιB: $ChanneLB[$counter] ~"; echo "ΚανάλιBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $ΚανάλιA[$counter]|"; + echo "ΚανάλιA: $ChanneLA[$counter] ~"; + echo "ΚανάλιB: $ChanneLB[$counter] ~"; + echo "ΚανάλιBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_el/manager_send.php b/agc_2-X/trunk/LANG_www/agc_el/manager_send.php index 5ccefdc6..3b48c646 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_el/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; + echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; + echo "ExtraΚανάλι $extrachannel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; + echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; + echo "exten $exten πρέπει να τεθεί\n"; + echo "ext_context $ext_context πρέπει να τεθεί\n"; + echo "ext_priority $ext_priority πρέπει να τεθεί\n"; + echo "\nRedirect Action μην σταλμένος\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Κανάλι $channel δεν είναι ενεργό στο $call_server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Κανάλι $channel δεν είναι ενεργό στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect εντολή που δεν έγινε εισαγωγή\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX εντολή που στέλνεται για Κανάλι $channel στο $call_server_ip and \nHungup $extrachannel στο $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_el/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_el/park_calls_display.php index cfaee591..4937023c 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_el/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_el/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_el/vdc_db_query.php index 33a08dc9..8c1ea0af 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_el/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Εκστρατεία $campaign δεν ισχύει\n"; + echo "lead_id $lead_id δεν ισχύει\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If ΚΛΗΣΗBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHΠΑΛΑΙΟ", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservation στο the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation στο the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc_el/vicidial.php b/agc_2-X/trunk/LANG_www/agc_el/vicidial.php index f9986fe0..1a9a91c3 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_el/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of δευτερόλεπτα for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign name στο login pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DST στο server for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "English Ελληνικά
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ echo "
Επανασύνδεση
\n"; #echo "\n"; echo "

Σύνδεση χρήστη

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ echo "\n";echo "\n"; echo "
Σύνδεση εκστρατείας
English Ελληνικά
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "\n";echo "\n";echo "
Σύνδεση
English Ελληνικά
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "Η σύνδεση δεν είναι σωστή, παρακαλώ προσπαθήστε πάλι
"; } @@ -616,7 +647,7 @@ echo "
Σύνδεση Τηλεφώνου
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ echo "
Σύνδεση εκστρατείας
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1000,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Φεβρουάριος','February','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος', + 'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,7 +1380,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; var DiaLControl_auto_HTML = "\"Παύση\"\"Επανάληψη\""; var DiaLControl_auto_HTML_ready = "\"Παύση\"\"Επανάληψη\""; var DiaLControl_auto_HTML_OFF = "\"Παύση\"\"Επανάληψη\""; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CXFER","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("AXFER","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1849,7 +1923,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Στάση"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { @@ -1857,7 +1939,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Εναρξη"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("AXFER","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CXFER","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2136,7 +2250,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { var conf_rec_start_html = "\"Εναρξη"; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; } @@ -2527,6 +2641,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; + all_record_count=0; document.getElementById("DiaLControl").innerHTML = "\"Κλήση"; if (document.vicidial_form.LeadPreview.checked==true) { @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICIΚΛΗΣΗ_web_QUERY_STRING =~ s/ /+/gi; // $VICIΚΛΗΣΗ_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2698,7 +2814,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"΄Κλείσιμο"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTΤηλE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2903,7 +3020,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"΄Κλείσιμο"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("Κανάλι has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3213,7 +3395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Εναρξη"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_δευτερόλεπτα > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -5073,7 +5263,7 @@ echo "\n"; - + @@ -5336,7 +5526,7 @@ if ( ($alt_phone_dialing) and ($auto_dial_level==0) )
΄Κλείσιμο Πελάτη

-Στείλε DTMF
+Στείλε DTMF
@@ -5372,7 +5562,7 @@ if ( ($alt_phone_dialing) and ($auto_dial_level==0) ) - + diff --git a/agc_2-X/trunk/LANG_www/agc_el/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_el/voicemail_check.php index fb48dfb4..fb64e8a9 100644 --- a/agc_2-X/trunk/LANG_www/agc_el/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_el/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_en/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_en/active_list_refresh.php index dd977642..7ea0bff0 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_en/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_en/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_en/astguiclient.php index 6ce6b5d0..ac01f994 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_en/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo "\n";echo "\n";echo "
Σύνδεση Error
  (Αυτό είναι συνήθως ένα 1 στις ΗΠΑ)
Τηλ Number:   (10 ψηφία μόνο)  (12 digits max - digits only)
Αναζήτηση Οδηγών:   (Η επιλογή αυτή επιτρέπει να βρει τον αριθμό στο σύστημα προτού γίνει εισαγωγή ως νέος οδηγός)   ID προμηθευτού:
Τηλ:   Κωδικός Κλήσης:   Εναλ/κό Τηλ:   Κωδικός Κλήσης:   Εναλ/κό Τηλ:
Παρουσίαση:   Ηλεκτρονικό ταχυδρομείο: 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/agc_en/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_en/call_log_display.php index 4abec74d..28d3ea87 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_en/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_en/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_en/conf_exten_check.php index 1f93e8ec..8915d813 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_en/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_en/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_en/inbound_popup.php index e26c4496..c92583de 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_en/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_en/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_en/live_exten_check.php index e0ca96c8..3dadf572 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_en/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $ChannelA[$loop_count] = "$row[0]"; - $ChannelB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; echo "ChannelBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $ChannelA[$counter]|"; + echo "ChannelA: $ChanneLA[$counter] ~"; + echo "ChannelB: $ChanneLB[$counter] ~"; + echo "ChannelBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_en/manager_send.php b/agc_2-X/trunk/LANG_www/agc_en/manager_send.php index b934cbb8..5bfe93f1 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_en/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "One of these variables is not valid:\n"; + echo "Channel $channel must be greater than 2 characters\n"; + echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; + echo "queryCID $queryCID must be greater than 14 characters\n"; + echo "exten $exten must be set\n"; + echo "ext_context $ext_context must be set\n"; + echo "ext_priority $ext_priority must be set\n"; + echo "\nRedirect Action not sent\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect command not inserted\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX command sent for Channel $channel on $call_server_ip and \nHungup $extrachannel on $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_en/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_en/park_calls_display.php index 246591b1..872f5780 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_en/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_en/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_en/vdc_db_query.php index 40f6a5c5..866c0584 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_en/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Campaign $campaign is not valid\n"; + echo "lead_id $lead_id is not valid\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If CALLBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHOLD", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation on the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc_en/vicidial.php b/agc_2-X/trunk/LANG_www/agc_en/vicidial.php index a6e01659..942bf92b 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_en/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of seconds for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign name on login pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DST on server for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "English Español
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ echo "
Re-Login
\n"; #echo "\n"; echo "

User Login

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ echo "\n";echo "\n"; echo "
Campaign Login
English Español
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "\n";echo "\n";echo "
Login
English Español
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "Login incorrect, please try again
"; } @@ -616,7 +647,7 @@ echo "
Phone Login
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ echo "\n";echo "\n";echo "
Campaign Login
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,7 +1380,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Resume\""; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CXFER","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("AXFER","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1849,7 +1923,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Stop"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Start"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { @@ -1857,7 +1939,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; var conf_rec_start_html = "\"Start"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Start"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("AXFER","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CXFER","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2136,7 +2250,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { var conf_rec_start_html = "\"Start"; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Start"; } @@ -2527,6 +2641,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; + all_record_count=0; document.getElementById("DiaLControl").innerHTML = "\"Dial"; if (document.vicidial_form.LeadPreview.checked==true) { @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; // $VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2698,7 +2814,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Hangup"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTPhoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2903,7 +3020,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Hangup"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("Channel has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3213,7 +3395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Start"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_seconds > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -5073,7 +5263,7 @@ echo "\n"; - + @@ -5336,7 +5526,7 @@ RECORD ID:

Hangup Customer

-Send DTMF
+Send DTMF
@@ -5372,7 +5562,7 @@ RECORD ID:
- + diff --git a/agc_2-X/trunk/LANG_www/agc_en/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_en/voicemail_check.php index 9cc655c6..0aa152d7 100644 --- a/agc_2-X/trunk/LANG_www/agc_en/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_en/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php index 4d86b89b..667ad057 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo " - - - - - + + + + +
Login Error
  (This is usually a 1 in the USA-Canada)
Phone Number:   (10 digits max - digits only)  (12 digits max - digits only)
Search Existing Leads:   (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)   Vendor ID:
Phone:   DialCode:   Alt. Phone:   DialCode:   Alt. Phone:
Show:   Email: 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php index 4d230270..d2725c58 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php @@ -123,6 +123,7 @@ # 60821-1628 - Added ALLFORCE recording option # 60821-1643 - Added no_delete_sessions option to not delete sessions # 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -168,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '2.0.96'; -$build = '60821-1643'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -416,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -449,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -621,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "La conexión incorrecta, intentelo otra vez, por favor
"; } @@ -1033,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Enero','February','Marcha','Abril','Puede','Junio', + 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; diff --git a/agc_2-X/trunk/LANG_www/agc_fr/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_fr/active_list_refresh.php index df742e06..217e73a9 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_fr/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_fr/astguiclient.php index 1d294dd3..a196f9fb 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo "
0) + { + fwrite ($fp, "VICICADRAN|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICICADRAN|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICICADRAN|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } @@ -484,15 +490,15 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var phone_pass = ''; var session_name = ''; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_fr.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_fr.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_voicemail_OFF = new Image(); - image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF_fr.gif"; + image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF.gif"; var image_voicemail_ON = new Image(); - image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON_fr.gif"; + image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON.gif"; var image_voicemail_BLINK = new Image(); - image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK_fr.gif"; + image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK.gif"; var favorites = new Array(); var favorites_names = new Array(); var favorites_busy = new Array(); @@ -2713,11 +2719,11 @@ echo "\n"; DÉCONNEXION
\n"; ?>
Panneau PrincipalLignes Actives PanneauPanneau De ConférencesVérifiez VoicemailVivent L'AppelPanneau PrincipalLignes Actives PanneauPanneau De ConférencesVérifiez VoicemailVivent L'Appel
diff --git a/agc_2-X/trunk/LANG_www/agc_fr/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_fr/call_log_display.php index 2d6379db..8d57383d 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_fr/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_fr/conf_exten_check.php index ca269d5f..246d2ee2 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_fr/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_fr/inbound_popup.php index 558eb7f5..53d8fa76 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_fr/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_fr/live_exten_check.php index 499b228d..f5bd9eaa 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $LaMancheA[$loop_count] = "$row[0]"; - $LaMancheB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; + echo "LaMancheA: $ChanneLA[$counter] ~"; + echo "LaMancheB: $ChanneLB[$counter] ~"; echo "LaMancheBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; + echo "LaMancheA: $ChanneLA[$counter] ~"; + echo "LaMancheB: $ChanneLB[$counter] ~"; echo "LaMancheBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; + echo "LaMancheA: $ChanneLA[$counter] ~"; + echo "LaMancheB: $ChanneLB[$counter] ~"; echo "LaMancheBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; + echo "LaMancheA: $ChanneLA[$counter] ~"; + echo "LaMancheB: $ChanneLB[$counter] ~"; echo "LaMancheBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $LaMancheA[$counter]|"; + echo "LaMancheA: $ChanneLA[$counter] ~"; + echo "LaMancheB: $ChanneLB[$counter] ~"; + echo "LaMancheBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_fr/manager_send.php b/agc_2-X/trunk/LANG_www/agc_fr/manager_send.php index 85887f16..9c7c52e2 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Une de ces variables est inadmissible:\n"; + echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; + echo "ExtraLaManche $extrachannel doivent être les 2 caractères plus grands que\n"; + echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; + echo "exten $exten doit être placé\n"; + echo "ext_context $ext_context doit être placé\n"; + echo "ext_priority $ext_priority doit être placé\n"; + echo "\nRedirect Action non envoyé\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "LaManche $channel n'est pas de phase sur $call_server_ip, Redirect commande non insérée\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "LaManche $channel n'est pas de phase sur $server_ip, Redirect commande non insérée\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect commande non insérée\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX commande envoyée pour LaManche $channel sur $call_server_ip and \nHungup $extrachannel sur $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_fr/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_fr/park_calls_display.php index 23d5e3b5..4f510ffa 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_fr/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_fr/vdc_db_query.php index 00a742e8..cc9c72b4 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Campagne $campaign est inadmissible\n"; + echo "lead_id $lead_id est inadmissible\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If APPELBK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHVIEUX", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservation sur the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation sur the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc_fr/vicidial.php b/agc_2-X/trunk/LANG_www/agc_fr/vicidial.php index 92f42160..c8586515 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of secondes for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign name sur login pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DST sur server for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "
English Français
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ echo "
Re-Ouverture
\n"; #echo "\n"; echo "

Ouverture D'Utilisateur

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ echo "\n";echo "\n"; echo "
Ouverture De Campagne
English Français
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "\n";echo "\n";echo "
Ouverture
English Français
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "L'ouverture incorrecte, essayent svp encore
"; } @@ -616,7 +647,7 @@ echo "\n";echo "\n";echo "
Ouverture De Téléphone
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ echo " - + @@ -5102,28 +5292,28 @@ Votre Statut:
Calls Dialing: @@ -5308,7 +5498,7 @@ Votre Statut:
Calls Dialing: @@ -5372,7 +5562,7 @@ IDENTIFICATION DISQUE:   Identification De Fournisseur: - + @@ -5400,7 +5590,7 @@ else
Ouverture De Campagne
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1000,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Janvier','February','Mars','Avril','Peut','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,61 +1380,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' - var DiaLControl_auto_HTML = "\"Pause\"\"Résumé\""; - var DiaLControl_auto_HTML_ready = "\"Pause\"\"Résumé\""; - var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Résumé\""; - var DiaLControl_manual_HTML = "\"Prochain"; + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; + var DiaLControl_auto_HTML = "\"Pause\"\"Résumé\""; + var DiaLControl_auto_HTML_ready = "\"Pause\"\"Résumé\""; + var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Résumé\""; + var DiaLControl_manual_HTML = "\"Prochain"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_fr.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_fr.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_LB_dialnextnumber = new Image(); - image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber_fr.gif"; + image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber.gif"; var image_LB_hangupcustomer = new Image(); - image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer_fr.gif"; + image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer.gif"; var image_LB_transferconf = new Image(); - image_LB_transferconf.src="../agc/images/vdc_LB_transferconf_fr.gif"; + image_LB_transferconf.src="../agc/images/vdc_LB_transferconf.gif"; var image_LB_grabparkedcall = new Image(); - image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall_fr.gif"; + image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall.gif"; var image_LB_parkcall = new Image(); - image_LB_parkcall.src="../agc/images/vdc_LB_parkcall_fr.gif"; + image_LB_parkcall.src="../agc/images/vdc_LB_parkcall.gif"; var image_LB_webform = new Image(); - image_LB_webform.src="../agc/images/vdc_LB_webform_fr.gif"; + image_LB_webform.src="../agc/images/vdc_LB_webform.gif"; var image_LB_stoprecording = new Image(); - image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording_fr.gif"; + image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording.gif"; var image_LB_startrecording = new Image(); - image_LB_startrecording.src="../agc/images/vdc_LB_startrecording_fr.gif"; + image_LB_startrecording.src="../agc/images/vdc_LB_startrecording.gif"; var image_LB_pause = new Image(); - image_LB_pause.src="../agc/images/vdc_LB_pause_fr.gif"; + image_LB_pause.src="../agc/images/vdc_LB_pause.gif"; var image_LB_resume = new Image(); - image_LB_resume.src="../agc/images/vdc_LB_resume_fr.gif"; + image_LB_resume.src="../agc/images/vdc_LB_resume.gif"; var image_LB_senddtmf = new Image(); - image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf_fr.gif"; + image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf.gif"; var image_LB_dialnextnumber_OFF = new Image(); - image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF_fr.gif"; + image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF.gif"; var image_LB_hangupcustomer_OFF = new Image(); - image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF_fr.gif"; + image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF.gif"; var image_LB_transferconf_OFF = new Image(); - image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF_fr.gif"; + image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF.gif"; var image_LB_grabparkedcall_OFF = new Image(); image_LB_grabparkedcall_OFF.src="../agc/images/vdc_LB_grabparkedcall_OFF.gif"; var image_LB_parkcall_OFF = new Image(); - image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF_fr.gif"; + image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF.gif"; var image_LB_webform_OFF = new Image(); - image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF_fr.gif"; + image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF.gif"; var image_LB_stoprecording_OFF = new Image(); image_LB_stoprecording_OFF.src="../agc/images/vdc_LB_stoprecording_OFF.gif"; var image_LB_startrecording_OFF = new Image(); image_LB_startrecording_OFF.src="../agc/images/vdc_LB_startrecording_OFF.gif"; var image_LB_pause_OFF = new Image(); - image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF_fr.gif"; + image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF.gif"; var image_LB_resume_OFF = new Image(); - image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF_fr.gif"; + image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF.gif"; var image_LB_senddtmf_OFF = new Image(); - image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF_fr.gif"; + image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF.gif"; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CXFER","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("AXFER","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1572,7 +1646,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; XDcheck = 'YES'; - // document.getElementById("HangupXferLine").innerHTML ="\"Ligne"; + // document.getElementById("HangupXferLine").innerHTML ="\"Ligne"; } } } @@ -1848,16 +1922,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // filename = filedate + "_" + user_abb; var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Cessez"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Cessez"; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Commencez"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { filename = taskconffile; var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Commencez"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Commencez"; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Commencez"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("AXFER","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CXFER","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2006,7 +2120,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var parkedby = protocol + "/" + extension; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; - document.getElementById("ParkControl").innerHTML ="\"Appel"; + document.getElementById("ParkControl").innerHTML ="\"Appel"; customerparked=1; } if (taskvar == 'FROMParK') @@ -2027,7 +2141,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; - document.getElementById("ParkControl").innerHTML ="\"Appel"; + document.getElementById("ParkControl").innerHTML ="\"Appel"; customerparked=0; } @@ -2135,8 +2249,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // alert("VICICADRAN Call log entered:\n" + document.vicidial_form.uniqueid.value); if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { - var conf_rec_start_html = "\"Commencez"; - if (campaign_recording == 'NEVER') + var conf_rec_start_html = "\"Commencez"; + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Commencez"; } @@ -2447,15 +2561,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Tiers appelé: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"APPEL"; + document.getElementById("Leave3WayCall").innerHTML ="\"APPEL"; - document.getElementById("DialWithCustomer").innerHTML ="\"Cadran"; + document.getElementById("DialWithCustomer").innerHTML ="\"Cadran"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Cadran"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Cadran"; - document.getElementById("HangupXferLine").innerHTML ="\"Ligne"; + document.getElementById("HangupXferLine").innerHTML ="\"Ligne"; - document.getElementById("HangupBothLines").innerHTML ="\"Décrochement"; + document.getElementById("HangupBothLines").innerHTML ="\"Décrochement"; xferchannellive=1; XDcheck = ''; @@ -2486,17 +2600,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=0; document.getElementById("MainStatuSSpan").innerHTML = " Appelé: " + lead_dial_number + " UID: " + CIDcheck + "  "; - document.getElementById("ParkControl").innerHTML ="\"Appel"; + document.getElementById("ParkControl").innerHTML ="\"Appel"; - document.getElementById("HangupControl").innerHTML = "\"Client"; + document.getElementById("HangupControl").innerHTML = "\"Client"; - document.getElementById("XferControl").innerHTML = "\"Transfert"; + document.getElementById("XferControl").innerHTML = "\"Transfert"; - document.getElementById("LocalCloser").innerHTML = "\"GENS"; + document.getElementById("LocalCloser").innerHTML = "\"GENS"; - document.getElementById("InternalCloser").innerHTML = "\"PLUS"; + document.getElementById("InternalCloser").innerHTML = "\"PLUS"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -2527,7 +2641,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; - document.getElementById("DiaLControl").innerHTML = "\"Prochain"; + all_record_count=0; + document.getElementById("DiaLControl").innerHTML = "\"Prochain"; if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICICADRAN_web_QUERY_STRING =~ s/ /+/gi; // $VICICADRAN_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2688,7 +2804,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; if (document.vicidial_form.LeadPreview.checked==false) { @@ -2696,9 +2812,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("HangupControl").innerHTML = "\"Client"; + document.getElementById("HangupControl").innerHTML = "\"Client"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2745,7 +2861,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Prochain"; + document.getElementById("DiaLControl").innerHTML = "\"Prochain"; var xmlhttp=false; /*@cc_on @*/ @@ -2822,7 +2938,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go sur to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Prochain"; + document.getElementById("DiaLControl").innerHTML = "\"Prochain"; } } } @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTTéléphoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2901,9 +3018,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + manDiaLonly_num + " UID: " + MDnextCID + "   Anneau d'attente..."; - document.getElementById("HangupControl").innerHTML = "\"Client"; + document.getElementById("HangupControl").innerHTML = "\"Client"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("LaManche has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3132,17 +3313,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } - document.getElementById("ParkControl").innerHTML ="\"Appel"; + document.getElementById("ParkControl").innerHTML ="\"Appel"; - document.getElementById("HangupControl").innerHTML = "\"Client"; + document.getElementById("HangupControl").innerHTML = "\"Client"; - document.getElementById("XferControl").innerHTML = "\"Transfert"; + document.getElementById("XferControl").innerHTML = "\"Transfert"; - document.getElementById("LocalCloser").innerHTML = "\"GENS"; + document.getElementById("LocalCloser").innerHTML = "\"GENS"; - document.getElementById("InternalCloser").innerHTML = "\"PLUS"; + document.getElementById("InternalCloser").innerHTML = "\"PLUS"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3211,9 +3393,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3320,11 +3503,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Forme\n"; } } @@ -3479,13 +3662,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip=''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - document.getElementById("WebFormSpan").innerHTML = "\"Forme"; - document.getElementById("ParkControl").innerHTML = "\"Appel"; - document.getElementById("HangupControl").innerHTML = "\"Client"; - document.getElementById("XferControl").innerHTML = "\"Transfert"; - document.getElementById("LocalCloser").innerHTML = "\"GENS"; - document.getElementById("InternalCloser").innerHTML = "\"PLUS"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; + document.getElementById("WebFormSpan").innerHTML = "\"Forme"; + document.getElementById("ParkControl").innerHTML = "\"Appel"; + document.getElementById("HangupControl").innerHTML = "\"Client"; + document.getElementById("XferControl").innerHTML = "\"Transfert"; + document.getElementById("LocalCloser").innerHTML = "\"GENS"; + document.getElementById("InternalCloser").innerHTML = "\"PLUS"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.vicidial_form.custdatetime.value = ''; @@ -3498,7 +3681,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Prochain"; + document.getElementById("DiaLControl").innerHTML = "\"Prochain"; reselect_alt_dial = 0; } } @@ -3591,15 +3774,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"APPEL"; + document.getElementById("Leave3WayCall").innerHTML ="\"APPEL"; - document.getElementById("DialWithCustomer").innerHTML ="\"Cadran"; + document.getElementById("DialWithCustomer").innerHTML ="\"Cadran"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Cadran"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Cadran"; - document.getElementById("HangupXferLine").innerHTML ="\"Ligne"; + document.getElementById("HangupXferLine").innerHTML ="\"Ligne"; - document.getElementById("HangupBothLines").innerHTML ="\"Décrochement"; + document.getElementById("HangupBothLines").innerHTML ="\"Décrochement"; } } @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Commencez"; } @@ -4531,7 +4714,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Prochain"; + document.getElementById("DiaLControl").innerHTML = "\"Prochain"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_secondes > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -4893,13 +5083,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('HotKeyEntriesBox'); hot_keys_active = 1; - document.getElementById("hotkeysdisplay").innerHTML = "\"TOUCHES"; + document.getElementById("hotkeysdisplay").innerHTML = "\"TOUCHES"; } else { hideDiv('HotKeyEntriesBox'); hot_keys_active = 0; - document.getElementById("hotkeysdisplay").innerHTML = "\"TOUCHES"; + document.getElementById("hotkeysdisplay").innerHTML = "\"TOUCHES"; } } @@ -4911,7 +5101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { HKbutton_allowed = 0; showDiv('TransferMain'); - document.getElementById("XferControl").innerHTML = "\"Transfert"; + document.getElementById("XferControl").innerHTML = "\"Transfert"; } else { @@ -4919,7 +5109,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('TransferMain'); if (showoffvar == 'YES') { - document.getElementById("XferControl").innerHTML = "\"Transfert"; + document.getElementById("XferControl").innerHTML = "\"Transfert"; } } } @@ -5029,7 +5219,7 @@ echo "\n"; - +
Ouverture Error
VICICADRAN SCRIPT   LIVE     ID de session: Vivent L'AppelVivent L'Appel
@@ -5073,7 +5263,7 @@ echo "\n";
  (C'est habituellement un 1 aux Etats-Unis et au Canada)
Téléphone Number:   (maximum de 10 chiffres - chiffres seulement)  (12 digits max - digits only)
Fils Existants De Recherche:   (Cette option si vérifié essayera de trouver le numéro de téléphone dans le système avant de l'insérer comme nouvelle avance)
- Transfert - Conférence
- PLUS ÉTROIT INTERNE - GENS DU PAYS PLUS ÉTROITS + Transfert - Conférence
+ PLUS ÉTROIT INTERNE + GENS DU PAYS PLUS ÉTROITS CODE - Ligne De Xfer De Décrochement - Décrochement Les deux Lignes + Ligne De Xfer De Décrochement + Décrochement Les deux Lignes
- Nombre à appeler   - secondes   - channel + Nombre à appeler   + secondes   + channel OVERRIDE   D1 D2
- Cadran Avec Le Client - Cadran De Client De Parc - APPEL DU CONGÉ 3-WAY - Transfert D'Aveugle De Cadran + Cadran Avec Le Client + Cadran De Client De Parc + APPEL DU CONGÉ 3-WAY + Transfert D'Aveugle De Cadran Blind Transfer VMail Message
-Prochain Nombre De Cadran
+Prochain Nombre De Cadran
PRÉVISION DE FIL
TÉLÉPHONE D'ALT
@@ -5327,16 +5517,16 @@ DOSSIER D'ENREGISTREMENT:
IDENTIFICATION DISQUE:
-Commencez À enregistrer
+Commencez À enregistrer

-Forme de Web
+Forme de Web

-Appel De Parc
-Transfert - Conférence
+Appel De Parc
+Transfert - Conférence

-Client De Décrochement
+Client De Décrochement

-Envoyez DTMF
+Envoyez DTMF
Téléphone:   DialCode:   Alt. Téléphone:   DialCode:   Alt. Téléphone:
Exposition:   Email:
diff --git a/agc_2-X/trunk/LANG_www/agc_fr/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_fr/voicemail_check.php index 0fbb86d2..f12fd65d 100644 --- a/agc_2-X/trunk/LANG_www/agc_fr/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_fr/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_it/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_it/active_list_refresh.php index 2be97476..ba71cd44 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_it/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_it/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_it/astguiclient.php index 81aebfef..94d90a1e 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_it/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo " - - - - - + + + + +
Version d'enchaînement-client de VICICADRAN:     CONSTRUCTION:               Serveur:              
Montrez l'information de canal de conférence téléphonique
0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TOUCHES DIRECTES INACTIVES +TOUCHES DIRECTES INACTIVES
0) + { + fwrite ($fp, "VICICHIAMA|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICICHIAMA|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICICHIAMA|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } @@ -484,15 +490,15 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var phone_pass = ''; var session_name = ''; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_it.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_it.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_voicemail_OFF = new Image(); - image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF_it.gif"; + image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF.gif"; var image_voicemail_ON = new Image(); - image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON_it.gif"; + image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON.gif"; var image_voicemail_BLINK = new Image(); - image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK_it.gif"; + image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK.gif"; var favorites = new Array(); var favorites_names = new Array(); var favorites_busy = new Array(); @@ -2713,11 +2719,11 @@ echo "\n"; LOGOUT
\n"; ?>
Pannello PrincipalePannello Linee Attive Pannello ConferenzeControlla la VoicemailChimate AttivePannello PrincipalePannello Linee Attive Pannello ConferenzeControlla la VoicemailChimate Attive
diff --git a/agc_2-X/trunk/LANG_www/agc_it/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_it/call_log_display.php index b4fc50b0..b05f0b42 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_it/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_it/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_it/conf_exten_check.php index 6589b92a..c32bff8c 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_it/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_it/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_it/inbound_popup.php index f4e1b9e8..c80ce26b 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_it/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_it/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_it/live_exten_check.php index 86eb2303..7c71701d 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_it/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $CanaleA[$loop_count] = "$row[0]"; - $CanaleB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaleA: $CanaleA[$counter] ~"; - echo "CanaleB: $CanaleB[$counter] ~"; + echo "CanaleA: $ChanneLA[$counter] ~"; + echo "CanaleB: $ChanneLB[$counter] ~"; echo "CanaleBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaleA: $CanaleA[$counter] ~"; - echo "CanaleB: $CanaleB[$counter] ~"; + echo "CanaleA: $ChanneLA[$counter] ~"; + echo "CanaleB: $ChanneLB[$counter] ~"; echo "CanaleBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaleA: $CanaleA[$counter] ~"; - echo "CanaleB: $CanaleB[$counter] ~"; + echo "CanaleA: $ChanneLA[$counter] ~"; + echo "CanaleB: $ChanneLB[$counter] ~"; echo "CanaleBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaleA: $CanaleA[$counter] ~"; - echo "CanaleB: $CanaleB[$counter] ~"; + echo "CanaleA: $ChanneLA[$counter] ~"; + echo "CanaleB: $ChanneLB[$counter] ~"; echo "CanaleBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "CanaleA: $CanaleA[$counter] ~"; - echo "CanaleB: $CanaleB[$counter] ~"; - echo "CanaleBtrunk: $CanaleA[$counter]|"; + echo "CanaleA: $ChanneLA[$counter] ~"; + echo "CanaleB: $ChanneLB[$counter] ~"; + echo "CanaleBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_it/manager_send.php b/agc_2-X/trunk/LANG_www/agc_it/manager_send.php index 0dc80c8d..859d7028 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_it/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Una di queste variabili non è valido:\n"; + echo "Canale $channel deve essere più grande di 2 caratteri\n"; + echo "ExtraCanale $extrachannel deve essere più grande di 2 caratteri\n"; + echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; + echo "exten $exten deve essere regolato\n"; + echo "ext_context $ext_context deve essere regolato\n"; + echo "ext_priority $ext_priority deve essere regolato\n"; + echo "\nRedirect Action non trasmesso\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canale $channel non è attivo su $call_server_ip, Redirect comando non inserito\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canale $channel non è attivo su $server_ip, Redirect comando non inserito\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect comando non inserito\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX comando inviato a Canale $channel su $call_server_ip and \nHungup $extrachannel su $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_it/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_it/park_calls_display.php index 3f05a237..5d246559 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_it/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php index 7f82ff0e..d78803a5 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_it/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Campagna $campaign non è valido\n"; + echo "lead_id $lead_id non è valido\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If CHIAMATABK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHVECCHIO", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservation su the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation su the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc_it/vicidial.php b/agc_2-X/trunk/LANG_www/agc_it/vicidial.php index 280deaa9..a0c44c3b 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_it/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of secondi for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign name su login pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DST su server for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "
English Italiano
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ echo ""; echo ""; echo "\n"; - echo "\n"; + echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "
Re-login attività
\n"; #echo "\n"; echo "

Inizio attività dell`Utente

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ echo "\n";echo "\n"; echo "
Inizio attività della Campagna
English Italiano
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "\n";echo "\n";echo "
Inizio attività
English Italiano
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "Inizio attività errato, prova di nuovo
"; } @@ -616,7 +647,7 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "
Inizio attività Telefono
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ echo " - + @@ -5102,28 +5292,28 @@ Vostro Status:
Calls Dialing: @@ -5308,7 +5498,7 @@ Vostro Status:
Calls Dialing: @@ -5372,7 +5562,7 @@ IDENTIFICAZIONE Registrazione:   ID Fornitore: - + @@ -5400,7 +5590,7 @@ else
Inizio attività della Campagna
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1000,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Gennaio','February','Marzo','Aprile','Può','Giugno', + 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,61 +1380,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' - var DiaLControl_auto_HTML = "\"Pausa\"\"Riprendi\""; - var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Riprendi\""; - var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Riprendi\""; - var DiaLControl_manual_HTML = "\"Chiama"; + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; + var DiaLControl_auto_HTML = "\"Pausa\"\"Riprendi\""; + var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Riprendi\""; + var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Riprendi\""; + var DiaLControl_manual_HTML = "\"Chiama"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_it.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_it.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_LB_dialnextnumber = new Image(); - image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber_it.gif"; + image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber.gif"; var image_LB_hangupcustomer = new Image(); - image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer_it.gif"; + image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer.gif"; var image_LB_transferconf = new Image(); - image_LB_transferconf.src="../agc/images/vdc_LB_transferconf_it.gif"; + image_LB_transferconf.src="../agc/images/vdc_LB_transferconf.gif"; var image_LB_grabparkedcall = new Image(); - image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall_it.gif"; + image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall.gif"; var image_LB_parkcall = new Image(); - image_LB_parkcall.src="../agc/images/vdc_LB_parkcall_it.gif"; + image_LB_parkcall.src="../agc/images/vdc_LB_parkcall.gif"; var image_LB_webform = new Image(); - image_LB_webform.src="../agc/images/vdc_LB_webform_it.gif"; + image_LB_webform.src="../agc/images/vdc_LB_webform.gif"; var image_LB_stoprecording = new Image(); - image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording_it.gif"; + image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording.gif"; var image_LB_startrecording = new Image(); - image_LB_startrecording.src="../agc/images/vdc_LB_startrecording_it.gif"; + image_LB_startrecording.src="../agc/images/vdc_LB_startrecording.gif"; var image_LB_pause = new Image(); - image_LB_pause.src="../agc/images/vdc_LB_pause_it.gif"; + image_LB_pause.src="../agc/images/vdc_LB_pause.gif"; var image_LB_resume = new Image(); - image_LB_resume.src="../agc/images/vdc_LB_resume_it.gif"; + image_LB_resume.src="../agc/images/vdc_LB_resume.gif"; var image_LB_senddtmf = new Image(); - image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf_it.gif"; + image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf.gif"; var image_LB_dialnextnumber_OFF = new Image(); - image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF_it.gif"; + image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF.gif"; var image_LB_hangupcustomer_OFF = new Image(); - image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF_it.gif"; + image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF.gif"; var image_LB_transferconf_OFF = new Image(); - image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF_it.gif"; + image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF.gif"; var image_LB_grabparkedcall_OFF = new Image(); image_LB_grabparkedcall_OFF.src="../agc/images/vdc_LB_grabparkedcall_OFF.gif"; var image_LB_parkcall_OFF = new Image(); - image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF_it.gif"; + image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF.gif"; var image_LB_webform_OFF = new Image(); - image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF_it.gif"; + image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF.gif"; var image_LB_stoprecording_OFF = new Image(); image_LB_stoprecording_OFF.src="../agc/images/vdc_LB_stoprecording_OFF.gif"; var image_LB_startrecording_OFF = new Image(); image_LB_startrecording_OFF.src="../agc/images/vdc_LB_startrecording_OFF.gif"; var image_LB_pause_OFF = new Image(); - image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF_it.gif"; + image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF.gif"; var image_LB_resume_OFF = new Image(); - image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF_it.gif"; + image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF.gif"; var image_LB_senddtmf_OFF = new Image(); - image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF_it.gif"; + image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF.gif"; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("TRASF","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CTRASF","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("ATRASF","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1572,7 +1646,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; XDcheck = 'YES'; - // document.getElementById("HangupXferLine").innerHTML ="\"Attacca"; + // document.getElementById("HangupXferLine").innerHTML ="\"Attacca"; } } } @@ -1848,16 +1922,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // filename = filedate + "_" + user_abb; var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Stop"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Stop"; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Inizia"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { filename = taskconffile; var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Inizia"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Inizia"; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Inizia"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("TRASF","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("ATRASF","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CTRASF","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2006,7 +2120,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var parkedby = protocol + "/" + extension; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; - document.getElementById("ParkControl").innerHTML ="\"Riprendi"; + document.getElementById("ParkControl").innerHTML ="\"Riprendi"; customerparked=1; } if (taskvar == 'FROMParK') @@ -2027,7 +2141,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; - document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; + document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; customerparked=0; } @@ -2135,8 +2249,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // alert("VICICHIAMA Call log entered:\n" + document.vicidial_form.uniqueid.value); if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { - var conf_rec_start_html = "\"Inizia"; - if (campaign_recording == 'NEVER') + var conf_rec_start_html = "\"Inizia"; + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Inizia"; } @@ -2447,15 +2561,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Chiamata l`altro chiamante: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"LASCIA"; + document.getElementById("Leave3WayCall").innerHTML ="\"LASCIA"; - document.getElementById("DialWithCustomer").innerHTML ="\"Chiama"; + document.getElementById("DialWithCustomer").innerHTML ="\"Chiama"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Parcheggia"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Parcheggia"; - document.getElementById("HangupXferLine").innerHTML ="\"Attacca"; + document.getElementById("HangupXferLine").innerHTML ="\"Attacca"; - document.getElementById("HangupBothLines").innerHTML ="\"Attacca"; + document.getElementById("HangupBothLines").innerHTML ="\"Attacca"; xferchannellive=1; XDcheck = ''; @@ -2486,17 +2600,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=0; document.getElementById("MainStatuSSpan").innerHTML = " Chiamato: " + lead_dial_number + " UID: " + CIDcheck + "  "; - document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; + document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; - document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; + document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; - document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + document.getElementById("XferControl").innerHTML = "\"Trasferimento"; - document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; + document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; + document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -2527,7 +2641,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + all_record_count=0; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICICHIAMA_web_QUERY_STRING =~ s/ /+/gi; // $VICICHIAMA_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2688,7 +2804,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; if (document.vicidial_form.LeadPreview.checked==false) { @@ -2696,9 +2812,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; + document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2745,7 +2861,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; var xmlhttp=false; /*@cc_on @*/ @@ -2822,7 +2938,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go su to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; } } } @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTTelefonoE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2901,9 +3018,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " In Chiamata: " + manDiaLonly_num + " UID: " + MDnextCID + "   Attendi lo squillo..."; - document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; + document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("Canale has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3132,17 +3313,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " In entrata: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } - document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; + document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; - document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; + document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; - document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + document.getElementById("XferControl").innerHTML = "\"Trasferimento"; - document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; + document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; + document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3211,9 +3393,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3320,11 +3503,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; } } @@ -3479,13 +3662,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip=''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia"; - document.getElementById("ParkControl").innerHTML = "\"Parcheggia"; - document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; - document.getElementById("XferControl").innerHTML = "\"Trasferimento"; - document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; + document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia"; + document.getElementById("ParkControl").innerHTML = "\"Parcheggia"; + document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; + document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; + document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.vicidial_form.custdatetime.value = ''; @@ -3498,7 +3681,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; reselect_alt_dial = 0; } } @@ -3591,15 +3774,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"LASCIA"; + document.getElementById("Leave3WayCall").innerHTML ="\"LASCIA"; - document.getElementById("DialWithCustomer").innerHTML ="\"Chiama"; + document.getElementById("DialWithCustomer").innerHTML ="\"Chiama"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Parcheggia"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Parcheggia"; - document.getElementById("HangupXferLine").innerHTML ="\"Attacca"; + document.getElementById("HangupXferLine").innerHTML ="\"Attacca"; - document.getElementById("HangupBothLines").innerHTML ="\"Attacca"; + document.getElementById("HangupBothLines").innerHTML ="\"Attacca"; } } @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Inizia"; } @@ -4531,7 +4714,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Chiama"; + document.getElementById("DiaLControl").innerHTML = "\"Chiama"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_secondi > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -4893,13 +5083,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('HotKeyEntriesBox'); hot_keys_active = 1; - document.getElementById("hotkeysdisplay").innerHTML = "\"TASTI"; + document.getElementById("hotkeysdisplay").innerHTML = "\"TASTI"; } else { hideDiv('HotKeyEntriesBox'); hot_keys_active = 0; - document.getElementById("hotkeysdisplay").innerHTML = "\"TASTI"; + document.getElementById("hotkeysdisplay").innerHTML = "\"TASTI"; } } @@ -4911,7 +5101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { HKbutton_allowed = 0; showDiv('TransferMain'); - document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + document.getElementById("XferControl").innerHTML = "\"Trasferimento"; } else { @@ -4919,7 +5109,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('TransferMain'); if (showoffvar == 'YES') { - document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + document.getElementById("XferControl").innerHTML = "\"Trasferimento"; } } } @@ -5029,7 +5219,7 @@ echo "\n"; - +
Inizio attività Error
VICICHIAMA SCRIPT   LIVE     ID di sessione: Chimate AttiveChimate Attive
@@ -5073,7 +5263,7 @@ echo "\n";
  (E solitamente un 1 negli USA e Canada)
Telefono Number:   (10 cifre massimo, digita solo)  (12 digits max - digits only)
Cerca Contatti esistenti:   (Questa opzione tenterà di trovare il numero di telefono nel sistema prima di inserire un nuovo contatto)
- Trasferimento - Conferenza
- INTERNO PIU` VICINO - LOCALE PIÙ VICINO + Trasferimento - Conferenza
+ INTERNO PIU` VICINO + LOCALE PIÙ VICINO CODE - Attacca la linea trasferita - Attacca ciascun linea + Attacca la linea trasferita + Attacca ciascun linea
- Numero da chiamare   - secondi   - channel + Numero da chiamare   + secondi   + channel OVERRIDE   D1 D2
- Chiama il Cliente - Parcheggia il cliente in chiamata - LASCIA LA CONFERENZA - Effettua il trasferimento cieco + Chiama il Cliente + Parcheggia il cliente in chiamata + LASCIA LA CONFERENZA + Effettua il trasferimento cieco Blind Transfer VMail Message
-Chiama il numero seguente
+Chiama il numero seguente
ANTEPRIMA CONTATTO
ALT CHIAMATE
@@ -5327,16 +5517,16 @@ REGISTRAZIONE DOCUMENTO:
IDENTIFICAZIONE Registrazione:
-Inizia la Registrazione
+Inizia la Registrazione

-Interfacccia Web
+Interfacccia Web

-Parcheggia la chiamata
-Trasferimento - Conferenza
+Parcheggia la chiamata
+Trasferimento - Conferenza

-Disconnetti il cliente
+Disconnetti il cliente

-Trasmetta DTMF
+Trasmetta DTMF
Telefono:   Prefisso:   Alt. Telefono:   Prefisso:   Alt. Telefono:
Mostra:   Email:
diff --git a/agc_2-X/trunk/LANG_www/agc_it/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_it/voicemail_check.php index 6d126916..1e0023d4 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_it/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_pl/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_pl/active_list_refresh.php index 8bc6a67f..542f49d5 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/active_list_refresh.php @@ -125,7 +125,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -159,14 +159,14 @@ if ($format=='table') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Listy: "; if ($ADD==1) {echo "Aktywne numery wewnętrzne";} -if ($ADD==2) {echo "Zajęte numery zewnętrzne";} +if ($ADD==2) {echo "Zajęte numery wewnętrzne";} if ($ADD==3) {echo "Linie zewnętrzne";} if ($ADD==4) {echo "Numery wewnętrzne";} if ($ADD==5) {echo "Konferencje";} -if ($ADD==99999) {echo "Pomoc";} +if ($ADD==99999) {echo "POMOC";} echo "\n"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/agc_pl/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_pl/astguiclient.php index 05a50538..f3634f2c 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -164,8 +164,8 @@ echo "\n"; echo ""; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "
Versione del webclient di VICICHIAMA:     CONFIGURAZIONE:               Server:              
Mostrate le informazioni sul canale della conferenza
0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TASTI FUNZIONE INATTIVI +TASTI FUNZIONE INATTIVI
Hasło telefonu:

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -183,13 +183,19 @@ echo "
0) + { + fwrite ($fp, "VICIWYBIERZ|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICIWybierz|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIWYBIERZ|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } @@ -198,7 +204,7 @@ header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) { @@ -221,8 +227,8 @@ echo "
Login telefonu:
Hasło telefonu:

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -253,13 +259,13 @@ echo "
Login telefonu
 
Login Twojego telefonu lub hasło są nieaktywne w systememie, spróbuj jeszcze raz:
 
 
Login Twojego telefonu lub hasło są nieaktywne w tym systememie, spróbuj jeszcze raz:
 
Login telefonu:
Hasło telefonu:

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -525,7 +531,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} ?> // ################################################################################ -// ACTIVE EXTENSIONS LIST Odswież FUNCTIONS +// ACTIVE EXTENSIONS LIST ODSWIEŻ FUNCTIONS function refresh_activeext() { document.getElementById("activeext").innerHTML = Nactiveext; @@ -616,7 +622,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} } // ################################################################################ -// BUSY TRUNK LIST Odswież FUNCTIONS +// BUSY TRUNK LIST ODSWIEŻ FUNCTIONS function refresh_busytrunk() { document.getElementById("busytrunk").innerHTML = Nbusytrunk; @@ -663,7 +669,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} } // ################################################################################ -// BUSY EXTENSIONS LIST Odswież FUNCTIONS +// BUSY EXTENSIONS LIST ODSWIEŻ FUNCTIONS function refresh_busyext() { document.getElementById("busyext").innerHTML = Nbusyext; @@ -710,7 +716,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} } // ################################################################################ -// LIVE TRUNK LIST FOR Rozłącz/HIJACK MENU FUNCTIONS +// LIVE TRUNK LIST FOR ROZŁĄCZ/HIJACK MENU FUNCTIONS function refresh_busytrunkhangup() { document.getElementById("TrunkHangupContent").innerHTML = Nactiveext; @@ -757,7 +763,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} } // ################################################################################ -// LIVE LOCAL LIST FOR Rozłącz/HIJACK MENU FUNCTIONS +// LIVE LOCAL LIST FOR ROZŁĄCZ/HIJACK MENU FUNCTIONS function refresh_busylocalhangup() { document.getElementById("LocalHangupContent").innerHTML = Nactiveext; @@ -1378,7 +1384,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=3; if (live_calls > 0) { - var live_calls_HTML = "Rozmowa xxx:
"; + var live_calls_HTML = "AKTYWNE ROZMOWY Z TEGO TELEFONU:
#Kanał klienckiKanał zdalnyNagrywajRozłączXFERPARKING
"; if ( (LCAcount > live_calls) || (LCAcount < live_calls) ) { LCAe[0]=''; LCAe[1]=''; LCAe[2]=''; LCAe[3]=''; LCAe[4]=''; LCAe[5]=''; @@ -1408,7 +1414,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} else {live_calls_HTML = live_calls_HTML + "Record";} - live_calls_HTML = live_calls_HTML + ""; + live_calls_HTML = live_calls_HTML + ""; if (LCAe[ARY_ct].length < 1) {LCAe[ARY_ct] = channelfieldA_array[1]; LCAcontent_change++; LCAalter++;} @@ -1525,7 +1531,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=0; if (out_calls > 0) { - var out_log_HTML = "
#KANAŁ KLIENCKIKANAŁ ZDALNYNAGRYWAJROZŁĄCZTRANSFERPARKING
RozłączXFERPARKING
ROZŁĄCZTRANSFERPARKING
" + var out_log_HTML = "
# Połączenie Data/CzasNumerDługość (M:SS)
" while (loop_ct < out_calls) { loop_ct++; @@ -1539,7 +1545,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_out_datetime = call_array[1]; var call_out_number = call_array[2]; var call_out_length = call_array[3]; - out_log_HTML = out_log_HTML + ""; + out_log_HTML = out_log_HTML + ""; } out_log_HTML = out_log_HTML + "
# POŁĄCZENIE DATA/CZASNUMERDŁUGOŚĆ (M:SS)
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " Wybierz
" + loop_ct + "" + call_out_datetime + "" + call_out_number + "" + call_out_length + " WYBIERZ
"; @@ -1553,7 +1559,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=0; if (in_calls > 0) { - var in_log_HTML = "" + var in_log_HTML = "
# Połączenie Data/CzasIN-NumerCALLERIDDługość
" while (loop_ct < in_calls) { loop_ct++; @@ -1569,7 +1575,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var call_in_idnum = call_array[3]; var call_in_idname = call_array[4]; var call_in_length = call_array[5]; - in_log_HTML = in_log_HTML + ""; + in_log_HTML = in_log_HTML + ""; } in_log_HTML = in_log_HTML + "
# POŁĄCZENIE DATA/CZASIN-NUMERIDROZMÓWCYDŁUGOŚĆ
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " Wybierz
" + loop_ct + "" + call_in_datetime + "" + call_in_number + "" + call_in_idnum + "" + call_in_idname + "" + call_in_length + " WYBIERZ
"; @@ -1628,7 +1634,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=-1; if (parked_count > 0) { - var park_HTML = "" + var park_HTML = "
#CHANNEL
  Rozmowa ID
Zawieszone przez
  Czas zawieszenia
RozłączXFERODBIERZ
" while (loop_ct < parked_count) { loop_ct++; @@ -1644,7 +1650,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var park_call_id = park_array[1]; var parked_by = park_array[3]; var parked_time = park_array[4]; - park_HTML = park_HTML + ""; + park_HTML = park_HTML + ""; } park_HTML = park_HTML + "
#CHANNEL
  Rozmowa ID
ZAWIESZONE PRZEZ
  CZAS ZAWIESZENIA
ROZŁĄCZTRANSFERODBIERZ
" + loop_ct + "" + park_channel + "
  " + park_call_id + "
" + parked_by + "
  " + parked_time + "
RozłączXFERODBIERZ
" + loop_ct + "" + park_channel + "
  " + park_call_id + "
" + parked_by + "
  " + parked_time + "
ROZŁĄCZTRANSFERODBIERZ
"; @@ -1817,7 +1823,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var LMAcontent_change=0; var LMAcontent_match=0; var conv_start=-1; - var live_conf_HTML = "Rozmowa xxx:
"; + var live_conf_HTML = "AKTYWNE ROZMOWY W TEJ KONFERENCJI:
#Kanał zdalnyRozłączXFER
"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; @@ -1833,7 +1839,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} @@ -2055,7 +2061,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} } // ################################################################################ -// Send Originate command to manager to direct user to skrzynka głosowa +// Send Originate command to manager to direct user to skrzynka poczty głosowej function SendCheckVoiceMail() { var xmlhttp=false; @@ -2282,7 +2288,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var VD_favlist_ct_half = parseInt(favlistCT / 2); if (VD_favlist_ct_half < 30) {VD_favlist_ct_half = 30;} var favlist_sec_col = 0; - var favedit_HTML = "
#KANAŁ ZDALNYROZŁĄCZTRANSFER
" + loop_ct + "" + channelfieldA + "RozłączXFER
" + loop_ct + "" + channelfieldA + "ROZŁĄCZTRANSFER
Dostępne numery wewnętrzne Ulubione
"; + var favedit_HTML = "
- +
DOSTĘPNE NUMERY WEWNĘTRZNE ULUBIONE
"; loop_ct = 0; while (loop_ct < favlistCT) { @@ -2379,7 +2385,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} hideDiv('MainPanel'); showDiv('LogouTBox'); - document.getElementById("LogouTBoxLink").innerHTML = "Naciśnij aby ponownie się zalogować\n"; + document.getElementById("LogouTBoxLink").innerHTML = "KLINKNIJ TU, ABY PONOWNIE ZALOGOWAĆ SIĘ\n"; logout_stop_timeouts = 1; @@ -2460,7 +2466,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} start_all_refresh(); } function pause() // Pauses the refreshing of the lists - {active_display=2; display_message=" - Aktywne wyświetlanie zatrzymane -";} + {active_display=2; display_message=" - AKTYWNE WYŚWIETLANIE WRZYMANE -";} function start() // resumes the refreshing of the lists {active_display=1; display_message='';} function faster() // lowers by 1000 milliseconds the time until the next refresh @@ -2481,13 +2487,13 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} function activeext_order_asc() // changes order of activeext list to ascending { activeext_order="asc"; getactiveext(); - desc_order_HTML ='ORDER'; + desc_order_HTML ='PORZĄDEK'; document.getElementById("activeext_order").innerHTML = desc_order_HTML; } function activeext_order_desc() // changes order of activeext list to descending { activeext_order="desc"; getactiveext(); - asc_order_HTML ='ORDER'; + asc_order_HTML ='PORZĄDEK'; document.getElementById("activeext_order").innerHTML = asc_order_HTML; } @@ -2497,13 +2503,13 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} function busytrunk_order_asc() // changes order of busytrunk list to ascending { busytrunk_order="asc"; getbusytrunk(); - desc_order_HTML ='ORDER'; + desc_order_HTML ='PORZĄDEK'; document.getElementById("busytrunk_order").innerHTML = desc_order_HTML; } function busytrunk_order_desc() // changes order of busytrunk list to descending { busytrunk_order="desc"; getbusytrunk(); - asc_order_HTML ='ORDER'; + asc_order_HTML ='PORZĄDEK'; document.getElementById("busytrunk_order").innerHTML = asc_order_HTML; } function busytrunkhangup_force_refresh() // forces immediate refresh of list content @@ -2515,13 +2521,13 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} function busyext_order_asc() // changes order of busyext list to ascending { busyext_order="asc"; getbusyext(); - desc_order_HTML ='ORDER'; + desc_order_HTML ='PORZĄDEK'; document.getElementById("busyext_order").innerHTML = desc_order_HTML; } function busyext_order_desc() // changes order of busyext list to descending { busyext_order="desc"; getbusyext(); - asc_order_HTML ='ORDER'; + asc_order_HTML ='PORZĄDEK'; document.getElementById("busyext_order").innerHTML = asc_order_HTML; } function busylocalhangup_force_refresh() // forces immediate refresh of list content @@ -2710,14 +2716,14 @@ echo "\n";
-LOGOUT
\n"; ?> +WYLOGUJ
\n"; ?>
Główny panel Panel aktywnych lini Panel konferencyjny Sprawdź pocztę głosowąRozmowaAktywna rozmowa
@@ -2726,19 +2732,19 @@ echo "\n"; -
TRUNK Rozłącz

+
TRUNK ROZŁĄCZ

Active Trunks Menu
- Rozłącz Trunk   |   - Przejmij Trunk   |   - Podsłuchaj Trunk   |   + Rozłącz międzymiastową   |   + Przejmij międzymiastową   |   + Odsłuchaj międzymiastową   |   Odswież   |   Wróć do Głównego okna
-
Rozłącz

- MenĂş Local Activa
+
ROZŁĄCZ

+ Manu aktywnych lokalnych
Rozłącz lokalną   |   Przejmij lokalną   |   Podsłuchaj lokalną   |   @@ -2750,8 +2756,8 @@ echo "\n"; - - +
Rozmowa przeniesiona
Kanały do przeniesienia: Kanał
Numer wenętrzny:
Menu rozszerzeń
+ diff --git a/agc_2-X/trunk/LANG_www/agc_pl/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_pl/call_log_display.php index e5e93485..7b4f7786 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/call_log_display.php @@ -73,7 +73,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -107,7 +107,7 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Rejestr rozmów"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/agc_pl/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_pl/conf_exten_check.php index a6f08d61..7bb8efc3 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/conf_exten_check.php @@ -86,7 +86,7 @@ $random = (rand(1000000, 9999999) + 10000000); if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -120,7 +120,7 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Sprawdzanie numeru wewnętrznego konferencji"; echo "\n"; echo "\n"; @@ -244,7 +244,7 @@ echo " if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - echo "Konferencja $conf_exten zarejestrował się $exten\n"; + echo "Konferencja $conf_exten został zarejestrowany $exten\n"; } diff --git a/agc_2-X/trunk/LANG_www/agc_pl/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_pl/inbound_popup.php index 79323235..f94639af 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/inbound_popup.php @@ -85,7 +85,7 @@ if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -124,7 +124,7 @@ while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; ?> Przyhodzące rozmowa"; +echo "AKTYWNA PRZYHODZĄCA ROZMOWA"; echo "\n"; echo "\n"; echo "\n"; -echo "

Przyhodzące rozmowa

\n"; +echo "

AKTYWNA PRZYHODZĄCA ROZMOWA

\n"; echo "$NOW_TIME

\n"; } @@ -282,7 +282,7 @@ echo "$NOW_TIME

\n"; if ($format=='debug') {echo "\n";} echo "
AKTYWNA ROZMOWA PRZENIESIONA
Kanały do przeniesienia: Kanał
NumerWenętrzny:
Menu rozszerzeń

Przełącz do wybranego numeru wewnętrznego

@@ -2765,11 +2771,11 @@ echo "\n"; - + @@ -2777,7 +2783,7 @@ echo "\n"; -
Wybieranie numerów wewnętrznych
Połączenie przychodzące z: Kanał
Numer wenętrzny:
Menu rozszerzeń
NumerWenętrzny:
Menu rozszerzeń

Połącz z wybranym numerem wewnętrznym

- Połącz z wybraną skrzynką głosową

+ Połącz z wybraną skrzynką głosową

Odswież


Wróć do Głównego okna

- + - + - + - + - +
Zawieszone rozmowy:
+
ZAWIESZONE ROZMOWY:
Wróć do Głównego okna

@@ -2788,19 +2794,19 @@ echo "\n";
Poczta głosowa     Nowy:     Stary:             Wybieranie ręczne       Wybierz
POCZTAGŁOSOWA     NOWY:     STARY:             WYBIERANIE RĘCZNE       WYBIERZ
Zawieszone rozmowy: 0                Numery wewnętrzne
ZAWIESZONE ROZMOWY: 0                NUMERY WEWNĘTRZNE
Rozmowy wychodzące:
ROZMOWY WYCHODZĄCE:
Rozmowy przychodzące:
ROZMOWY PRZYCHODZĄCE:
astGUIclient WERSJA: BUILD:
astGUIclient WERSJA: KOMPILACJA:
- +
Ulubione       edytuj
$h) @@ -2818,9 +2824,9 @@ echo "\n"; -
ULUBIONE       edytuj
+
Ulubione
- +
ULUBIONE

 
Zatwierdzenie zmain wymaga logoutu
ZATWIERDŹ ZMIANY W ULUBIONYCH- wymaga wylogowania
Powrót do głónego okna - anulowanie wprowadzonych zmian
@@ -2835,24 +2841,24 @@ echo "\n";
Inicjalizuje..
Aktywne numery wewnętrzne
-Odswież | -ORDER | +ODSWIEŻ | +PORZĄDEK |
Linie zewnętrzne
-Odswież | -ORDER | +ODSWIEŻ | +PORZĄDEK |
Numery wewnętrzne
-Odswież | -ORDER | +ODSWIEŻ | +PORZĄDEK |
Data tutaj

- Data tutaj

Operacje na Trunk + Data tutaj

Operacje na międzymiastowych
Data tutaj

Operacje na lokalnych
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
Kanał: $row[1]
CallerID: $row[3]
IDRozmówcy: $row[3]
\n"; $phone = eregi_replace(".*\<","",$row[3]); @@ -315,14 +315,14 @@ echo "$NOW_TIME

\n"; $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOM - \n"; + echo "UŻYTKOWNIKA - \n"; echo "
Numery wybrane: $row[8]
Wybierany numer: $row[8]
Notatki: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "Rozłącz - \n"; - echo "Prześlij do poczty głosowej\n"; + echo "ROZŁĄCZ - \n"; + echo "PRZEŚLIJ DO MOJEJ POCZTY GŁOSOWEJ\n"; echo "
\n"; diff --git a/agc_2-X/trunk/LANG_www/agc_pl/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_pl/live_exten_check.php index cdf065c5..441f8eca 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/live_exten_check.php @@ -28,6 +28,7 @@ # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -58,8 +59,8 @@ $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.12'; -$build = '60619-1203'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -73,7 +74,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -107,7 +108,7 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Sprawdzanie aktywnych numerów wewnętrznych"; echo "\n"; echo "\n"; @@ -145,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $KanałA[$loop_count] = "$row[0]"; - $KanałB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -155,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -163,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "KanałA: $KanałA[$counter] ~"; - echo "KanałB: $KanałB[$counter] ~"; + echo "KanałA: $ChanneLA[$counter] ~"; + echo "KanałB: $ChanneLB[$counter] ~"; echo "KanałBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -177,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "KanałA: $KanałA[$counter] ~"; - echo "KanałB: $KanałB[$counter] ~"; + echo "KanałA: $ChanneLA[$counter] ~"; + echo "KanałB: $ChanneLB[$counter] ~"; echo "KanałBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -191,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "KanałA: $KanałA[$counter] ~"; - echo "KanałB: $KanałB[$counter] ~"; + echo "KanałA: $ChanneLA[$counter] ~"; + echo "KanałB: $ChanneLB[$counter] ~"; echo "KanałBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -205,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "KanałA: $KanałA[$counter] ~"; - echo "KanałB: $KanałB[$counter] ~"; + echo "KanałA: $ChanneLA[$counter] ~"; + echo "KanałB: $ChanneLB[$counter] ~"; echo "KanałBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "KanałA: $KanałA[$counter] ~"; - echo "KanałB: $KanałB[$counter] ~"; - echo "KanałBtrunk: $KanałA[$counter]|"; + echo "KanałA: $ChanneLA[$counter] ~"; + echo "KanałB: $ChanneLB[$counter] ~"; + echo "KanałBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_pl/manager_send.php b/agc_2-X/trunk/LANG_www/agc_pl/manager_send.php index 313d5089..9b2c1c36 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/manager_send.php @@ -142,7 +142,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -176,14 +176,14 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; -echo "Manager Send: "; +echo "<!-- WERSJA: $version KOMPILACJA: $build ACTION: $ACTION server_ip: $server_ip-->\n"; +echo "<title>Wyślij do zarządzania: "; if ($ACTION=="Originate") {echo "Originate";} if ($ACTION=="Redirect") {echo "Redirect";} if ($ACTION=="RedirectName") {echo "RedirectName";} if ($ACTION=="Hangup") {echo "Hangup";} if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "Pomoc";} +if ($ACTION==99999) {echo "POMOC";} echo "\n"; echo "\n"; echo "\n"; @@ -200,7 +200,7 @@ if ($ACTION=="SysCIDOriginate") { if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) { - echo "Exten $exten nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy, Originate komenda nie wprowadzona\n"; + echo "Exten $exten nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy, Originate komenda nie wstawiona\n"; } else { @@ -277,7 +277,7 @@ if ($ACTION=="Originate") { if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) { - echo "Exten $exten nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy, Originate komenda nie wprowadzona\n"; + echo "Exten $exten nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy, Originate komenda nie wstawiona\n"; } else { @@ -304,7 +304,7 @@ if ($ACTION=="HangupConfDial") if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) { $channel_live=0; - echo "conference $exten nie jest prawidłowy or ext_context $ext_context or queryCID $queryCID nie jest prawidłowy, Hangup komenda nie wprowadzona\n"; + echo "conference $exten nie jest prawidłowy or ext_context $ext_context or queryCID $queryCID nie jest prawidłowy, Hangup komenda nie wstawiona\n"; } else { @@ -341,7 +341,7 @@ if ($ACTION=="Hangup") if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) { $channel_live=0; - echo "Kanał $channel nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy, Hangup komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy, Hangup komenda nie wstawiona\n"; } else { @@ -380,7 +380,7 @@ if ($ACTION=="Hangup") if ($row[0]==0) { $channel_live=0; - echo "Kanał $channel nie jest aktywna na $call_server_ip, Hangup komenda nie wprowadzona $rowx[0]\n$stmt\n"; + echo "Kanał $channel nie jest aktywna na $call_server_ip, Hangup komenda nie wstawiona $rowx[0]\n$stmt\n"; } else { @@ -426,13 +426,13 @@ if ($ACTION=="RedirectVD") if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} if (eregi("CLOSER",$campaign)) { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANSFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } if ($auto_dial_level < 1) { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; + $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANSFER' where uniqueid='$uniqueid';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -587,7 +587,7 @@ if ($ACTION=="RedirectXtraCX") if ($rowx[0]==0) { $channel_liveX=0; - echo "Kanał $channel nie jest aktywna na $call_server_ip, Redirect komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest aktywna na $call_server_ip, Redirect komenda nie wstawiona\n"; } } $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; @@ -603,7 +603,7 @@ if ($ACTION=="RedirectXtraCX") if ($rowx[0]==0) { $channel_liveY=0; - echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wstawiona\n"; } } if ( ($channel_liveX==1) && ($channel_liveY==1) ) @@ -615,7 +615,7 @@ if ($ACTION=="RedirectXtraCX") if ($rowx[0] < 1) { $channel_liveY=0; - echo "No Local agent to send call to, Redirect komenda nie wprowadzona\n"; + echo "No Local agent to send call to, Redirect komenda nie wstawiona\n"; } else { @@ -701,7 +701,7 @@ if ($ACTION=="RedirectXtra") else { $channel_liveX=0; - echo "Nie mogę znaleźć wolnej konferencji na $server_ip, Redirect komenda nie wprowadzona\n"; + echo "Nie mogę znaleźć wolnej konferencji na $server_ip, Redirect komenda nie wstawiona\n"; } } @@ -720,7 +720,7 @@ if ($ACTION=="RedirectXtra") if ($rowx[0]==0) { $channel_liveX=0; - echo "Kanał $channel nie jest aktywna na $call_server_ip, Redirect komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest aktywna na $call_server_ip, Redirect komenda nie wstawiona\n"; } } $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; @@ -736,7 +736,7 @@ if ($ACTION=="RedirectXtra") if ($rowx[0]==0) { $channel_liveY=0; - echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wstawiona\n"; } } if ( ($channel_liveX==1) && ($channel_liveY==1) ) @@ -818,7 +818,7 @@ if ($ACTION=="Redirect") if ($rowx[0]==0) { $channel_live=0; - echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest aktywna na $server_ip, Redirect komenda nie wstawiona\n"; } } if ($channel_live==1) @@ -849,7 +849,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) { $channel_live=0; - echo "Kanał $channel nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy or filename: $filename nie jest prawidłowy, $ACTION komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy or filename: $filename nie jest prawidłowy, $ACTION komenda nie wstawiona\n"; } else { @@ -866,7 +866,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) if ($rowx[0]==0) { $channel_live=0; - echo "Kanał $channel nie jest aktywna na $server_ip, $ACTION komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest aktywna na $server_ip, $ACTION komenda nie wstawiona\n"; } } if ($channel_live==1) @@ -928,7 +928,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) { $channel_live=0; - echo "Kanał $channel nie jest prawidłowy or exten $exten nie jest prawidłowy or filename: $filename nie jest prawidłowy, $ACTION komenda nie wprowadzona\n"; + echo "Kanał $channel nie jest prawidłowy or exten $exten nie jest prawidłowy or filename: $filename nie jest prawidłowy, $ACTION komenda nie wstawiona\n"; } else { @@ -992,7 +992,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) } } - echo "$ACTION komenda wysłana do Kanał $channel na $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n Nagrywanie zakończy się po 60 minutach\n"; + echo "$ACTION komenda wysłana do Kanał $channel na $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n NAGRYWANIE BĘDZIE TRWAĆ MAKSYMALNIE 60 MINUT\n"; } } diff --git a/agc_2-X/trunk/LANG_www/agc_pl/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_pl/park_calls_display.php index 0458ac80..ff697873 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/park_calls_display.php @@ -64,7 +64,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -97,7 +97,7 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Zawieszone rozmowy"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/agc_pl/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_pl/vdc_db_query.php index f1618bf7..9a13ac36 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/vdc_db_query.php @@ -267,7 +267,7 @@ $auth=$row[0]; if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { -echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; +echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -301,8 +301,8 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; -echo "VICIDiaL Skrypt odpytujący bazę danych"; +echo "<!-- WERSJA: $version KOMPILACJA: $build USER: $user server_ip: $server_ip-->\n"; +echo "<title>VICIDiaL Skrypt zapytań do bazy danych"; echo "\n"; echo "\n"; echo "\n"; @@ -394,7 +394,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($row[0] > 0) { - echo "DNC Numer\n"; + echo "DNC NUMER\n"; exit; } } @@ -743,7 +743,7 @@ if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { - echo "LOG NOT ENTERED\n"; + echo "Dziennik nie zapisany\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign nie jest prawidłowy\n"; exit; } @@ -757,12 +757,12 @@ if ($stage == "start") if ($affected_rows > 0) { - echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n"; + echo "VICIDiaL_LOG Wstawiony: $uniqueid|$channel|$NOW_TIME\n"; echo "$StarTtime\n"; } else { - echo "LOG NOT ENTERED\n"; + echo "Dziennik nie zapisany\n"; } # ##### insert log into call_log for manual VICIDiaL call @@ -773,11 +773,11 @@ if ($stage == "start") # if ($affected_rows > 0) # { - # echo "CALL_LOG Inserted: $uniqueid|$channel|$NOW_TIME"; + # echo "CALL_LOG Wstawiony: $uniqueid|$channel|$NOW_TIME"; # } # else # { - # echo "LOG NOT ENTERED\n"; + # echo "Dziennik nie zapisany\n"; # } } } @@ -786,7 +786,7 @@ if ($stage == "end") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) { - echo "LOG NOT ENTERED\n"; + echo "Dziennik nie zapisany\n"; echo "uniqueid $uniqueid or lead_id: $lead_id nie jest prawidłowy\n"; exit; } @@ -850,7 +850,7 @@ if ($stage == "end") } else { - echo "LOG NOT ENTERED\n\n"; + echo "Dziennik nie zapisany\n\n"; } } @@ -1236,7 +1236,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); ### If RozmowaBK, change vicidial_callback record to INACTIVE - if (eregi("CALLBK|CBHStary", $dispo)) + if (eregi("CALLBK|CBHSTARY", $dispo)) { $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} @@ -1269,8 +1269,8 @@ if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) } else { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; + ##### Insert a WYLOGUJ record into the user log + $stmt="INSERT INTO vicidial_user_log values('','$user','WYLOGUJ','$campaign','$NOW_TIME','$StarTtime');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); @@ -1372,7 +1372,7 @@ if ($ACTION == 'updateDISPO') $agent_log_id = mysql_insert_id(); ### RozmowaBACK ENTRY - if ( ($dispo_choice == 'CBHStary') and (strlen($CallBackDatETimE)>10) ) + if ( ($dispo_choice == 'CBHSTARY') and (strlen($CallBackDatETimE)>10) ) { $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; if ($DB) {echo "$stmt\n";} @@ -1462,7 +1462,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } } } - echo 'Agent ' . $user . ' jest w statusie ' . $stage . "\n"; + echo 'Agent ' . $user . ' ma statusie ' . $stage . "\n"; } diff --git a/agc_2-X/trunk/LANG_www/agc_pl/vicidial.php b/agc_2-X/trunk/LANG_www/agc_pl/vicidial.php index d79ccc02..755e1ba8 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/vicidial.php @@ -122,6 +122,8 @@ # 60821-1555 - Added option to omit phone_code on dialout of leads # 60821-1628 - Added ALLFORCE recording option # 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -167,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '2.0.96'; -$build = '60821-1643'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -233,7 +235,7 @@ header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; if ($campaign_login_list > 0) { @@ -274,7 +276,7 @@ $camp_form_code = "klient VICIWybierz: Powtórne zalogowanie\n"; +echo "klient VICIWYBIERZ: Powtórne zalogowanie\n"; echo "\n"; echo "\n"; echo "\n"; @@ -297,8 +299,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "
Hasło użytkownika:
Kampania: $camp_form_code

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -310,7 +312,7 @@ if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { - echo "klient VICIWybierz: Logowanie do kampani\n"; + echo "klient VICIWYBIERZ: Logowanie do kampani\n"; echo "\n"; echo "\n"; echo "\n"; @@ -332,8 +334,8 @@ echo "\n"; echo ""; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "
Kampania: $camp_form_code

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -351,7 +353,7 @@ echo "
klient VICIWybierz: Login\n"; + echo "klient VICIWYBIERZ: Login\n"; echo "\n"; echo "\n"; echo "\n"; @@ -374,8 +376,8 @@ echo "\n"; echo ""; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "
Kampania: $camp_form_code

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -388,7 +390,7 @@ echo "
klient VICIWybierz: Login telefonu\n"; +echo "klient VICIWYBIERZ: Login telefonu\n"; echo "\n"; echo "\n"; echo "\n"; @@ -405,8 +407,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "
Login telefonu:
Hasło telefonu:

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -415,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -448,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -609,7 +614,7 @@ $VDloginDISPLAY=0; if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $campaign_leads_to_call = $row[0]; - print "\n"; + print "\n"; } else @@ -620,15 +625,18 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "Login nie aktywny, spróbuj jeszcze raz
"; } } if ($VDloginDISPLAY) { - echo "klient VICIWybierz: Logowanie do kampani\n"; + echo "klient VICIWYBIERZ: Logowanie do kampani\n"; echo "\n"; echo "\n"; echo "\n"; @@ -650,8 +658,8 @@ echo "\n"; echo ""; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "
Kampania: $camp_form_code

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -667,7 +675,7 @@ $row=mysql_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { - echo "klient VICIWybierz: Login telefonu Error\n"; + echo "klient VICIWYBIERZ: Login telefonu Error\n"; echo "\n"; echo "\n"; echo "\n"; @@ -682,13 +690,13 @@ echo ""; echo ""; echo "\n"; - echo "\n"; + echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "
Login Error
 
Login Twojego telefonu lub hasło są nieaktywne w systememie, spróbuj jeszcze raz:
 
 
Login Twojego telefonu lub hasło są nieaktywne w tym systememie, spróbuj jeszcze raz:
 
Login telefonu:
Hasło telefonu:

WERSJA: $version       BUILD: $build

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -697,7 +705,7 @@ echo "
klient VICIWybierz\n"; + echo "klient VICIWYBIERZ\n"; $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -750,7 +758,7 @@ else $updater_check_enabled=$row[45]; $AFLogging_enabled=$row[46]; $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; + $IDRozmówcy_popup_enabled=$row[48]; $voicemail_button_enabled=$row[49]; $enable_fast_refresh=$row[50]; $fast_refresh_rate=$row[51]; @@ -785,20 +793,20 @@ else { $VICIDiaL_park_on_extension = "$park_ext"; $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; + print "\n"; } - print "\n"; + print "\n"; # If a web form address is not set, use the default one if (strlen($web_form_address)>0) { $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; + print "\n"; } else { $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; + print "\n"; $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); } @@ -808,12 +816,12 @@ else if ($allow_closers=="Y") { $VICIDiaL_allow_closers = 1; - print "\n"; + print "\n"; } else { $VICIDiaL_allow_closers = 0; - print "\n"; + print "\n"; } @@ -855,7 +863,7 @@ else $i++; } if ($prev_login_ct > 0) - {print "\n";} + {print "\n";} else { ##### grab the next available vicidial_conference room and reserve it @@ -872,7 +880,7 @@ else } $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; $rslt=mysql_query($stmt, $link); - print "\n"; + print "\n"; } @@ -880,7 +888,7 @@ else if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} @@ -892,14 +900,14 @@ else if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; # print "You have logged in as user: $VD_login na phone: $SIP_user do kampani: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; ### use manager middleware-app to connect the phone to the user $SIqueryCID = "S$CIDdate$session_id"; - ### insert a Nowy record to the vicidial_manager table to be processed + ### insert a NOWY record to the vicidial_manager table to be processed $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -908,7 +916,7 @@ else if ($auto_dial_level > 0) { - print "\n"; + print "\n"; $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; @@ -932,13 +940,13 @@ else } else { - echo "klient VICIWybierz: VICIWybierz Logowanie do kampani\n"; + echo "klient VICIWYBIERZ: VICIWYBIERZ Logowanie do kampani\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; - echo "Niestety w zasobniku nie ma nowych numerów\n"; + echo "Niestety, w zasobniku nie ma kontaktów oczekujących wykonania połączeń dla tej kampanii\n"; echo "
\n"; echo "\n"; echo "\n"; @@ -946,7 +954,7 @@ echo "
\n
"; echo "Hasło:
\n"; echo "Kampania: $camp_form_code
\n"; - echo "\n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -954,7 +962,7 @@ echo "
klient VICIWybierz: VICIWybierz Logowanie do kampani\n"; + echo "klient VICIWYBIERZ: VICIWYBIERZ Logowanie do kampani\n"; echo "\n"; echo "\n"; echo "\n"; @@ -968,7 +976,7 @@ echo "
\n
"; echo "Hasło:
\n"; echo "Kampania: $camp_form_code
\n"; - echo "\n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1032,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Styczeń','February','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; @@ -1518,7 +1526,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - var regXFvars = new RegExp("XFER","g"); + var regXFvars = new RegExp("TRANSFER","g"); if (manual_string.match(regXFvars)) { var donothing=1; @@ -1574,7 +1582,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var regCXFvars = new RegExp("CXFER","g"); + var regCXFvars = new RegExp("CTRANSFER","g"); var tasknum_string = tasknum.toString(); if (tasknum_string.match(regCXFvars)) { @@ -1584,7 +1592,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; } - var regAXFvars = new RegExp("AXFER","g"); + var regAXFvars = new RegExp("ATRANSFER","g"); if (tasknum_string.match(regAXFvars)) { var Ctasknum = tasknum_string.replace(regAXFvars, ''); @@ -1638,7 +1646,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; XDcheck = 'YES'; - // document.getElementById("HangupXferLine").innerHTML ="
\"Hangup"; + // document.getElementById("HangupXferLine").innerHTML ="\"Rozłącz"; } } } @@ -1783,8 +1791,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var LMAcontent_change=0; var LMAcontent_match=0; var conv_start=-1; - // var live_conf_HTML = "Rozmowa xxx:
"; - var live_conf_HTML = "Rozmowa w Twojej sesji:
#Kanał zdalnyRozłączXFER
"; + // var live_conf_HTML = "AKTYWNE ROZMOWY W TEJ KONFERENCJI:
#Kanał zdalnyRozłącz
"; + var live_conf_HTML = "AKTYWNE ROZMOWY W TWOJEJ SESJI:
#KANAŁ ZDALNYROZŁĄCZTRANSFER
"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; @@ -1800,8 +1808,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - // live_conf_HTML = live_conf_HTML + ""; - live_conf_HTML = live_conf_HTML + ""; + // live_conf_HTML = live_conf_HTML + ""; + live_conf_HTML = live_conf_HTML + ""; // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -1976,7 +1984,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Redirect command for live call to Manager sends phone name where call is going to -// Covers the following types: XFER, VMAIL, ENTRY, CONF, PARKING, FROMPARKING, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL +// Covers the following types: TRANSFER, VMAIL, ENTRY, CONF, PARKING, FROMPARKING, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip) { var xmlhttp=false; @@ -2008,10 +2016,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - var regXFvars = new RegExp("XFER","g"); + var regXFvars = new RegExp("TRANSFER","g"); if (blindxferdialstring.match(regXFvars)) { - var regAXFvars = new RegExp("AXFER","g"); + var regAXFvars = new RegExp("ATRANSFER","g"); if (blindxferdialstring.match(regAXFvars)) { var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); @@ -2047,7 +2055,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { xferredirect_query=''; taskvar = 'NOTHING'; - alert("Przekierowanie musi mieć więcej niż 1 cyfrę:" + blindxferdialstring); + alert("Numer przekierowania musi mieć więcej niż 1 cyfrę:" + blindxferdialstring); } else { @@ -2097,7 +2105,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - var regRXFvars = new RegExp("CXFER","g"); + var regRXFvars = new RegExp("CTRANSFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} else @@ -2112,7 +2120,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var parkedby = protocol + "/" + extension; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; - document.getElementById("ParkControl").innerHTML ="\"Capturar"; + document.getElementById("ParkControl").innerHTML ="\"Przejmij"; customerparked=1; } if (taskvar == 'FROMParK') @@ -2133,7 +2141,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; - document.getElementById("ParkControl").innerHTML ="\"Zawieszona"; + document.getElementById("ParkControl").innerHTML ="\"Zawieś"; customerparked=0; } @@ -2185,7 +2193,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { reselect_alt_dial = 1; alt_dial_active = 1; - var man_status = "Dial Alt Telefon Number: MAIN PHONE or ALT PHONE or Adres3 or Zakończ rekord"; + var man_status = "Zadzwoń pod numer alt.: NUMER PODSTAWOWY or NUMER ALT. or ADRES3 or ZAKOŃCZ WPROWADZANIE DANYCH"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } } @@ -2231,14 +2239,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDlogResponse = xmlhttp.responseText; var MDlogResponse_array=MDlogResponse.split("\n"); MDlogLINE = MDlogResponse_array[0]; - if ( (MDlogLINE == "LOG NOT ENTERED") && (VDstop_rec_after_each_call != 1) ) + if ( (MDlogLINE == "Dziennik nie zapisany") && (VDstop_rec_after_each_call != 1) ) { // alert("error: log not entered\n"); } else { MDlogEPOCH = MDlogResponse_array[1]; - // alert("VICIWybierz Call log entered:\n" + document.vicidial_form.uniqueid.value); + // alert("VICIWYBIERZ Call log entered:\n" + document.vicidial_form.uniqueid.value); if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { var conf_rec_start_html = "\"Rozpocznij"; @@ -2308,7 +2316,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBcounT = xmlhttp.responseText; if (CBcounT == 0) {var CBprint = "NO";} else {var CBprint = CBcounT;} - document.getElementById("CBstatusSpan").innerHTML ="" + CBprint + " Aktywne inne terminy"; + document.getElementById("CBstatusSpan").innerHTML ="" + CBprint + " AKTYWNE INNE TERMINY"; } } @@ -2323,7 +2331,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("Musisz być w trybie przerwa żeby sprawdzić ustawion inne terminy"); + alert("MUSISZ WSTRZYMAC AUTOMATYCZNE WYBIERANIE NUMERU BY SPRAWDZAĆ INNE TERMINY"); } else { @@ -2365,7 +2373,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CB_calls = all_CBs_array[0]; var loop_ct=0; var conv_start=0; - var CB_HTML = "
#KANAŁ ZDALNYROZŁĄCZ
" + loop_ct + "" + channelfieldA + "HangupXFER
" + loop_ct + "" + channelfieldA + "Rozłącz
" + loop_ct + "" + channelfieldA + "HangupTRANSFER
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ
" + var CB_HTML = "
# RozmowaBACK DATE/TIMENumerNAMEStatusCAMPAIGNLAST Połączenie Data/Czas COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -2433,7 +2441,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("Musisz być w trybie przerwa żeby wybrać numer ręcznie"); + alert("MUSISZ WSTRZYMAC AUTOMATYCZNE WYBIERANIE NUMERU BY DOKONAĆ RĘCZNEGO WYBIERANIA"); } else { @@ -2525,7 +2533,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + lead_dial_number + " UID: " + CIDcheck + "   Czeka na połączenie... " + MD_ring_secondS + " sekundy"; + document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + lead_dial_number + " UID: " + CIDcheck + "   Czeka na dzwonek... " + MD_ring_secondS + " sekundy"; // alert("channel not found yet:\n" + campaign); } else @@ -2551,15 +2559,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} XD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Called 3rd party: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; + document.getElementById("MainStatuSSpan").innerHTML = " Zadzwoniono do trzeciej strony: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"LEAVE"; + document.getElementById("Leave3WayCall").innerHTML ="\"WYJDŹ"; - document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; + document.getElementById("DialWithCustomer").innerHTML ="\"Połącz"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Zawieś"; - document.getElementById("HangupXferLine").innerHTML ="\"Hangup"; + document.getElementById("HangupXferLine").innerHTML ="\"Rozłącz"; document.getElementById("HangupBothLines").innerHTML ="\"Rozłącz"; @@ -2590,24 +2598,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Called: " + lead_dial_number + " UID: " + CIDcheck + "  "; + document.getElementById("MainStatuSSpan").innerHTML = " Zadzwoniono: " + lead_dial_number + " UID: " + CIDcheck + "  "; - document.getElementById("ParkControl").innerHTML ="\"Zawieszona"; + document.getElementById("ParkControl").innerHTML ="\"Zawieś"; document.getElementById("HangupControl").innerHTML = "\"Odłącz"; document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALNY"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; + document.getElementById("InternalCloser").innerHTML = "\"WEWNĘTRZNY"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Wybierz"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - // INSERT VICIWybierz_LOG ENTRY FOR THIS Rozmowa PROCESS + // INSERT VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS DialLog("start"); custchannellive=1; @@ -2639,13 +2647,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { reselect_preview_dial = 1; var man_preview = 'YES'; - var man_status = "Zobacz kolenjy numer bez dzwonienia Wybierz numer or Pomiń numer"; + var man_status = "Podejżyj dane połączenia i WYBIERZ POŁĄCZENIE or POMIŃ POŁĄCZENIE"; } else { reselect_preview_dial = 0; var man_preview = 'NO'; - var man_status = "Czeka na połączenie..."; + var man_status = "Czeka na dzwonek..."; } var xmlhttp=false; @@ -2683,10 +2691,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "Zasobnik pusty") || (MDnextCID == "DNC Numer") ) + if ( (MDnextCID == "Zasobnik pusty") || (MDnextCID == "DNC NUMER") ) { if (MDnextCID == "Zasobnik pusty") - {alert("Brak numerów w zasobniku dla tej kampani:\n" + campaign);} + {alert("W zasobniku nie ma już więcej konaktów do wykonania połączeń dla tej kampanii:\n" + campaign);} else {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);} } @@ -2773,8 +2781,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + webform_session; -// $VICIWybierz_web_QUERY_STRING =~ s/ /+/gi; -// $VICIWybierz_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; +// $VICIWYBIERZ_web_QUERY_STRING =~ s/ /+/gi; +// $VICIWYBIERZ_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -2849,7 +2857,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (manual_dial_in_progress==1) { - alert('Nie możesz ominąć zadzwoń poźniej, musisz wybrać ten numer!'); + alert('NIE MOŻESZ POMINĄĆ RĘCZNEGO DZWONIENIA LUB ODDZWANIANIA, MUSISZ ZADZWONIĆ POD KONTAKT'); } else { @@ -2893,7 +2901,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDSnextCID = MDSnextResponse_array[0]; if (MDSnextCID == "LEAD NOT REVERTED") { - alert("Numer nie został przywrócowny, wystąpił błąd:\n" + MDSnextResponse); + alert("Dane połączenia nie zostały przywrócowne, wystąpił błąd:\n" + MDSnextResponse); } else { @@ -3001,14 +3009,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " Rozmowa NOT PLACED") { - alert("call was not placed, there was an error:\n" + MDOnextResponse); + alert("nie wykonano połączenia, wystąpił błąd:\n" + MDOnextResponse); } else { MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + manDiaLonly_num + " UID: " + MDnextCID + "   Czeka na połączenie..."; + document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + manDiaLonly_num + " UID: " + MDnextCID + "   Czeka na dzwonek..."; document.getElementById("HangupControl").innerHTML = "\"Odłącz"; @@ -3253,7 +3261,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_customer_call = 1; VD_live_call_secondS = 0; - // INSERT VICIWybierz_LOG ENTRY FOR THIS Rozmowa PROCESS + // INSERT VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS // DialLog("start"); custchannellive=1; @@ -3305,17 +3313,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } - document.getElementById("ParkControl").innerHTML ="\"Zawieszona"; + document.getElementById("ParkControl").innerHTML ="\"Zawieś"; document.getElementById("HangupControl").innerHTML = "\"Odłącz"; document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALNY"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; + document.getElementById("InternalCloser").innerHTML = "\"WEWNĘTRZNY"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Wybierz"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3608,7 +3616,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_ring_secondS = 0; CalLCID = ''; - // UPDATE VICIWybierz_LOG ENTRY FOR THIS Rozmowa PROCESS + // UPDATE VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS DialLog("end"); if (dispowindow == 'NO') { @@ -3655,12 +3663,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} document.getElementById("WebFormSpan").innerHTML = "\"Web"; - document.getElementById("ParkControl").innerHTML = "\"Zawieszona"; + document.getElementById("ParkControl").innerHTML = "\"Zawieś"; document.getElementById("HangupControl").innerHTML = "\"Odłącz"; document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALNY"; + document.getElementById("InternalCloser").innerHTML = "\"WEWNĘTRZNY"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Wybierz"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.vicidial_form.custdatetime.value = ''; @@ -3766,13 +3774,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"LEAVE"; + document.getElementById("Leave3WayCall").innerHTML ="\"WYJDŹ"; - document.getElementById("DialWithCustomer").innerHTML ="\"Dial"; + document.getElementById("DialWithCustomer").innerHTML ="\"Połącz"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Park"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Zawieś"; - document.getElementById("HangupXferLine").innerHTML ="\"Hangup"; + document.getElementById("HangupXferLine").innerHTML ="\"Rozłącz"; document.getElementById("HangupBothLines").innerHTML ="\"Rozłącz"; } @@ -4108,7 +4116,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } // ################################################################################ -// Pokaż message that there are no voice channels in the VICIWybierz session +// Pokaż message that there are no voice channels in the VICIWYBIERZ session function NoneInSession() { showDiv('NoneInSessionBox'); @@ -4188,7 +4196,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (VU_agent_choose_ingroups == '1') { - var live_CSC_HTML = "
# RozmowaBACK DATE/TIMENUMERNAMESTATUSCAMPAIGNLAST POŁĄCZENIE DATA/CZAS COMMENTS
Nie wybrana grupaGrupa wybrana
"; + var live_CSC_HTML = "
GRUPY NIE WYBRANEWYBRANE GRUPY
"; var loop_ct = 0; while (loop_ct < INgroupCOUNT) { @@ -4319,12 +4327,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function LogouT() { if (MD_channel_look==1) - {alert("Nie możesz wylogować się w trakcie wybierania. \nPoczekaj 50 sekund żeby wybieranie zostało przerwane");} + {alert("Nie możesz wylogować się w trakcie dokonywania połączenia. \nPoczekaj 50 sekund aby, w przypadku nieodebrania, połączenie nie doszło do skutku");} else { if (VD_live_customer_call==1) { - alert("Jesteś w trakcie rozmowy! Rozłącz się aby się wylogować.\n" + VD_live_customer_call); + alert("JESTEŚ W TRAKCIE ROZMOWY! Rozłącz się by móc się wylogować.\n" + VD_live_customer_call); } else { @@ -4366,7 +4374,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('MainPanel'); showDiv('LogouTBox'); - document.getElementById("LogouTBoxLink").innerHTML = "Naciśnij aby ponownie się zalogować\n"; + document.getElementById("LogouTBoxLink").innerHTML = "KLINKNIJ TU, ABY PONOWNIE ZALOGOWAĆ SIĘ\n"; logout_stop_timeouts = 1; @@ -4603,7 +4611,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // alert(CallBackDatETimE + "|" + CallBackCommenTs); - document.vicidial_form.DispoSelection.value = 'CBHStary'; + document.vicidial_form.DispoSelection.value = 'CBHSTARY'; hideDiv('CallBackSelectBox'); DispoSelect_submit(); } @@ -4641,7 +4649,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('NoneInSessionBox'); hideDiv('WrapupBox'); hideDiv('TransferMain'); - hideDiv('WitamBoxA'); + hideDiv('WitajBoxA'); hideDiv('CallBackSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); @@ -4907,7 +4915,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} start_all_refresh(); } function pause() // Pauses the refreshing of the lists - {active_display=2; display_message=" - Aktywne wyświetlanie zatrzymane - ";} + {active_display=2; display_message=" - AKTYWNE WYŚWIETLANIE WRZYMANE - ";} function start() // resumes the refreshing of the lists {active_display=1; display_message='';} function faster() // lowers by 1000 milliseconds the time until the next refresh @@ -4926,13 +4934,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function activeext_order_asc() // changes order of activeext list to ascending { activeext_order="asc"; getactiveext(); - desc_order_HTML ='ORDER'; + desc_order_HTML ='PORZĄDEK'; document.getElementById("activeext_order").innerHTML = desc_order_HTML; } function activeext_order_desc() // changes order of activeext list to descending { activeext_order="desc"; getactiveext(); - asc_order_HTML ='ORDER'; + asc_order_HTML ='PORZĄDEK'; document.getElementById("activeext_order").innerHTML = asc_order_HTML; } @@ -4942,13 +4950,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function busytrunk_order_asc() // changes order of busytrunk list to ascending { busytrunk_order="asc"; getbusytrunk(); - desc_order_HTML ='ORDER'; + desc_order_HTML ='PORZĄDEK'; document.getElementById("busytrunk_order").innerHTML = desc_order_HTML; } function busytrunk_order_desc() // changes order of busytrunk list to descending { busytrunk_order="desc"; getbusytrunk(); - asc_order_HTML ='ORDER'; + asc_order_HTML ='PORZĄDEK'; document.getElementById("busytrunk_order").innerHTML = asc_order_HTML; } function busytrunkhangup_force_refresh() // forces immediate refresh of list content @@ -4960,13 +4968,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function busyext_order_asc() // changes order of busyext list to ascending { busyext_order="asc"; getbusyext(); - desc_order_HTML ='ORDER'; + desc_order_HTML ='PORZĄDEK'; document.getElementById("busyext_order").innerHTML = desc_order_HTML; } function busyext_order_desc() // changes order of busyext list to descending { busyext_order="desc"; getbusyext(); - asc_order_HTML ='ORDER'; + asc_order_HTML ='PORZĄDEK'; document.getElementById("busyext_order").innerHTML = asc_order_HTML; } function busylocalhangup_force_refresh() // forces immediate refresh of list content @@ -4997,12 +5005,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById(divvar).innerHTML = ''; if (divvar == 'DiaLLeaDPrevieW') { - var buildDivHTML = " Podgląd numeru
"; + var buildDivHTML = " PODGLĄD POŁĄCZEŃ
"; document.getElementById("DiaLLeaDPrevieWHide").innerHTML = buildDivHTML; } if (divvar == 'DiaLDiaLAltPhonE') { - var buildDivHTML = " Zadzwoń pod drugi numer
"; + var buildDivHTML = " WYBIERANIE DRUGIEGO NUMERU
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } } @@ -5015,7 +5023,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (divvar == 'DiaLLeaDPrevieW') { document.getElementById("DiaLLeaDPrevieWHide").innerHTML = ''; - var buildDivHTML = " Podgląd numeru
"; + var buildDivHTML = " PODGLĄD POŁĄCZEŃ
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_preview_dial==1) {document.vicidial_form.LeadPreview.checked=true} @@ -5023,7 +5031,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (divvar == 'DiaLDiaLAltPhonE') { document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = ''; - var buildDivHTML = " Zadzwoń pod drugi numer
"; + var buildDivHTML = " WYBIERANIE DRUGIEGO NUMERU
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} @@ -5055,14 +5063,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (divvar == 'SHOW') { conf_channels_xtra_display = 1; - document.getElementById("busycallsdisplay").innerHTML = "Ukryj informacje konferencjach"; + document.getElementById("busycallsdisplay").innerHTML = "Ukryj informacje o kanałach konferencyjnych"; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; } else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Pokaż informacje o konferencjach"; + document.getElementById("busycallsdisplay").innerHTML = "Pokaż informacje o kanałach konferencyjnych"; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5075,13 +5083,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('HotKeyEntriesBox'); hot_keys_active = 1; - document.getElementById("hotkeysdisplay").innerHTML = "\"Klawisze"; + document.getElementById("hotkeysdisplay").innerHTML = "\"KLAWISZE"; } else { hideDiv('HotKeyEntriesBox'); hot_keys_active = 0; - document.getElementById("hotkeysdisplay").innerHTML = "\"Klawisze"; + document.getElementById("hotkeysdisplay").innerHTML = "\"KLAWISZE"; } } @@ -5109,7 +5117,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar != 'OFF') { - alert('Nie masz uprawnień do przenoszenia rozmów'); + alert('NIE MASZ UPRAWNIEŃ DO PRZENOSZENIA ROZMÓW'); } } } @@ -5201,36 +5209,36 @@ echo "\n"; -
LOGOUT\n"; ?> +WYLOGUJ\n"; ?>
- + - +
VICIWybierzVICIWYBIERZ SCRIPT   LIVE     ID sesji: RozmowaAktywna rozmowa
- -

VICIWybierz
+ +

VICIWYBIERZ
-Wybieranie ręczne
+WYBIERANIE RĘCZNE
-X Aktywne inne terminy
+X AKTYWNE INNE TERMINY
-
Inne terminy dla agenta :
Wybierz link inny termin żeby połączyć się teraz.. + \n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1509,7 +1539,7 @@ if ($ADD==41) { echo "
SERVIDOR MODIFICADO: $server_ip\n"; - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; + $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', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); } } @@ -1537,10 +1567,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
INNE TERMINY DLA AGENTA :
Kliknij poniżej na Inne terminy żeby teraz zadzwonić do klienta. Jeżeli klikniesz na rekordzie by zadzwonić, rekord zostanie usunięty z listy.

  @@ -5241,29 +5249,29 @@ echo "\n"; - \n"; echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1287,10 +1314,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Ręczne wybieranie numeru dla :

Wpisz poniżej informacje o numerze pod który chcesz zadzwonić. + @@ -5314,7 +5322,7 @@ Twój Status:
Calls Dialing:
NOWE RĘCZNE WYBIERANIE NUMERU DLA :

Wpisz poniżej informacje o kontakcie do którego chcesz wykonać połączenie.
\n"; + echo "Komentarz: Prefiks numeru $dial_prefix będzie dodane na początku tego numeru
\n"; } ?> - Note: all new manual dial leads will go into list 999

+ Ważne: nowe kontakty z ręcznym wybieraniem zostaną zapisane na liście 999

- - + + - + - + - +
Dial Code:   (This is usually a 1 in the USA-Canada) Kod wybierania:   (dla polski będzie to 48)
Telefon Number:   (maksymalnie 10 cyfr)  (12 digits max - digits only)
Przeszukuj rekordy:   (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)


Jeżeli chcesz wybrać numer którego nie został dodany do listy wpisz numer .....
 


Jeżeli chcesz wybrać numer tak aby NIE został dodany jako nowy kontakt, wpisz dokładny numer telefonu w polu Wybierz ten numer poniżej. By zakończyć połączenie musisz otworzyć ROZMOWY W TEJ SESJI (w dole ekranu), i zakończyć połączenie klinając na link jego kanału..
 
Dial Override: Wybierz ten numer:   (tylko cyfry)

@@ -5285,10 +5293,10 @@ Twój Status:
Calls Dialing: Transfer - Konferencja
- INTERNAL CLOSER - CLOSER LOCAL + WEWNĘTRZNY FINALIZUJĄCYCH + LOKALNY FINALIZUJĄCYCH CODE - Hangup Xfer Line + Rozłącz linię transferu Rozłącz obie linie
@@ -5302,10 +5310,10 @@ Twój Status:
Calls Dialing: D2
- Dial With Customer - Park Customer Dial - LEAVE 3-WAY Rozmowa - Dial Blind Transfer + Połącz z klientem + Zawieś połączenie z klientem + WYJDŹ Z ROZMOWY 3-STRONNEJ + Wybierz numer do nieweryfikowanego transferu Blind Transfer VMail Message
-
Rezultat rozmowy:

+
Połączenie rozdysponowane jako:

-
@@ -5322,7 +5330,7 @@ Twój Status:
Calls Dialing: - \n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1509,7 +1539,7 @@ if ($ADD==41) { 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';"; + $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', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); } } @@ -1537,10 +1567,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Klawisze skrótu: +
Klawisze skrótu dyspozycji: Kiedy aktywne, naciśnij guzik na klawiaturze w celu wybrania opcji dla tej rozmowy. Rozmowa zostanie automatycznie rozłączona a opcja ustawiona:
@@ -5337,7 +5345,7 @@ Twój Status:
Calls Dialing: - \n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1287,10 +1314,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Nie ma telefonu w Twojej sesji:
+ \n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1509,7 +1539,7 @@ if ($ADD==41) { echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $server_ip\n"; - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; + $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', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); } } @@ -1537,10 +1567,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Nikt nie uczestniczy w Twojej sesji:
Wróć

Ponownie połącz się z telefonem @@ -5354,8 +5362,7 @@ Twój Status:
Calls Dialing: - \n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1287,10 +1314,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Call Wrapup - sekundy remaining in wrapup

+
Call Wrapup sekundy remaining in wrapup



Finish Wrapup and Move On @@ -5364,7 +5371,7 @@ Twój Status:
Calls Dialing: -

LOGOUT
+

WYLOGUJ
@@ -5383,18 +5390,18 @@ Twój Status:
Calls Dialing:
REZULTAT ROZMOWY :       Rozłącz się ponownie       minimalizuj
Koniec rozmowy, wybierz rezultat
- Zatrzymaj dzwonienie
- Wyczyść formularz | - Zatwierdź + ZATRZYMAJ DZWONIENIE
+ WYCZYŚĆ FORMULARZ | + ZATWIERDŹ

- WEB FORM Zatwierdź + WEB FORM ZATWIERDŹ

 
- \n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1509,7 +1539,7 @@ if ($ADD==41) { echo "
BEDIENER GEÄNDERT: $server_ip\n"; - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; + $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', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); } } @@ -1537,10 +1567,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Wybierz datę inny termin :
+
Wybierz datę oddzwonienia :
Wybierz datę poniżej   @@ -5426,23 +5433,23 @@ Twój Status:
Calls Dialing: Tylko moje inne terminy
";} + {echo " TYLKO MOJE INNE TERMINY
";} ?> Notatki:

- Zatwierdź

+ ZATWIERDŹ



 
- \n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1287,10 +1314,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
CLOSER INBOUND GROUP SELECTION
- Closer Inbound Group Selection +
SELEKCJA GRUPY ZAWNĘTRZNYCH FINALIZUJĄCYCH
+ Selekcja grupy zawnętrznych finalizujących
- BLENDED RozmowaING(wychodzące aktywowane)
- Reset | - Zatwierdź + KOMBINOWANE POŁĄCZENIA(wychodzące aktywowane)
+ RESET | + ZATWIERDŹ



 
@@ -5453,21 +5460,21 @@ Twój Status:
Calls Dialing: Kanał Tylko moje inne terminy
";} + {echo " TYLKO MOJE INNE TERMINY
";} ?> - - +
Rozmowa przeniesiona
Kanały do przeniesienia: Kanał
Numer wenętrzny:
Menu rozszerzeń
+
AKTYWNA ROZMOWA PRZENIESIONA
Kanały do przeniesienia: Kanał
NumerWenętrzny:
Menu rozszerzeń

Przełącz do wybranego numeru wewnętrznego

Przełącz do poczty głosowej

Przełącz do numeru:


- Odswież


+ ODSWIEŻ


Wróć do Głównego okna

Konferencje:
(wybierz poniższy numer w celu przełączenia do konferencji)
Przełącz również mój kanał
Menu konferencji
@@ -5476,7 +5483,7 @@ Twój Status:
Calls Dialing: -
VICIWybierz SCRIPT
+
VICIWYBIERZ SCRIPT
@@ -5484,37 +5491,37 @@ Twój Status:
Calls Dialing: - +\n";echo "\n";echo "
Status:
STATUS:
Wybierz kolejny numer
- Podgląd numeru
- Zadzwoń pod drugi numer
+ PODGLĄD POŁĄCZEŃ
+ WYBIERANIE DRUGIEGO NUMERU
-Plik nagrania:
+PLIK NAGRANIA:

-Nagrywaj ID:
+NUMER NAGRANIA:
Rozpocznij nagrywanie

Web Formularz

-Zawieszona rozmowa
+Zawieś rozmowę
Transfer - Konferencja

Odłącz kilenta
@@ -5535,7 +5542,7 @@ Nagrywaj ID:
- + @@ -5549,13 +5556,13 @@ Nagrywaj ID:
- + - + @@ -5580,10 +5587,10 @@ else - - - - - + + + + +
sekundy:   Kanał:   Zegar:   Kanał:   Ustawiony Czas:
Informacje o kliencie:
  Adres3:
Miasto:   Stan:   Kod pocztowy:   Stan:   KodPocztowy:
Powiat:   Vendedor ID:
Telefon:   Prefix:   Drugi telefon:   Prefiks:   Drugi telefon:
Pokaż:   Email:
-
wersja klienta VICIWybierz:     BUILD:               Serwer:              
-Pokaż informacje o konferencjach
+ @@ -5595,7 +5602,7 @@ else
wersja klienta VICIWYBIERZ:     KOMPILACJA:               Serwer:              
+Pokaż informacje o kanałach konferencyjnych
0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -Klawisze skrótu nieaktywne +KLAWISZE SKRÓTU NIEAKTYWNE
- +
diff --git a/agc_2-X/trunk/LANG_www/agc_pl/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_pl/voicemail_check.php index 0f4925f8..ffdc3ed9 100644 --- a/agc_2-X/trunk/LANG_www/agc_pl/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_pl/voicemail_check.php @@ -61,7 +61,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) { - echo "Nieprawidłowy Nazwa użytkownika/Hasło: |$user|$pass|\n"; + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; exit; } else @@ -95,7 +95,7 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Sprawdzanie poczty głosowej"; echo "\n"; echo "\n"; @@ -107,7 +107,7 @@ echo " if (strlen($vmail_box)<1) { $channel_live=0; - echo "skrzynka głosowa $vmail_box nie jest prawidłowy\n"; + echo "skrzynka poczty głosowej $vmail_box nie jest prawidłowy\n"; exit; } else diff --git a/agc_2-X/trunk/LANG_www/agc_pt/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_pt/active_list_refresh.php index 11e2d444..0b915374 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/active_list_refresh.php @@ -37,6 +37,7 @@ # 50610-1155 - Added NULL check on MySQL results to reduced errors # 50711-1209 - removed HTTP authentication in favor of user/pass vars # 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1118 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -79,6 +80,24 @@ if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} +### security strip all non-alphanumeric characters out of the variables ### + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $ADD=ereg_replace("[^0-9]","",$ADD); + $order=ereg_replace("[^0-9a-zA-Z]","",$order); + $format=ereg_replace("[^0-9a-zA-Z]","",$format); + $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); + $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); + $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); + $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); + $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); + $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); + $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); + $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); + $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); + $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); + $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); + # default optional vars if not set if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} @@ -91,8 +110,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';} if (!isset($textareaheight)) {$textareaheight='10';} if (!isset($textareawidth)) {$textareawidth='20';} -$version = '0.0.7'; -$build = '60421-1155'; +$version = '0.0.8'; +$build = '60619-1118'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_pt/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_pt/astguiclient.php index 97029a76..1c6a291f 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/astguiclient.php @@ -55,12 +55,11 @@ # 60112-1622 - Several formatting changes # 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60619-1103 - Added variable filters to close security holes for login form +# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); -#require_once("htglobalize.php"); - ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -88,8 +87,8 @@ $user_abb = "$user$user$user$user"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} -$version = '1.1.12'; -$build = '60619-1103'; +$version = '2.0.1'; +$build = '60829-1528'; ### security strip all non-alphanumeric characters out of the variables ### $DB=ereg_replace("[^0-9a-z]","",$DB); @@ -124,7 +123,8 @@ $FILE_TIME = date("Ymd-His"); $US='_'; $CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./astguiclient_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -183,13 +183,19 @@ echo "
0) + { + fwrite ($fp, "VICISELETOR|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "VICISELETOR|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICISELETOR|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } } @@ -484,15 +490,15 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var phone_pass = ''; var session_name = ''; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_pt.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_pt.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_voicemail_OFF = new Image(); - image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF_pt.gif"; + image_voicemail_OFF.src="../agc/images/agc_check_voicemail_OFF.gif"; var image_voicemail_ON = new Image(); - image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON_pt.gif"; + image_voicemail_ON.src="../agc/images/agc_check_voicemail_ON.gif"; var image_voicemail_BLINK = new Image(); - image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK_pt.gif"; + image_voicemail_BLINK.src="../agc/images/agc_check_voicemail_BLINK.gif"; var favorites = new Array(); var favorites_names = new Array(); var favorites_busy = new Array(); @@ -2713,11 +2719,11 @@ echo "\n"; LOGOUT
\n"; ?>
Painel PrincipalLinhas Ativas PainelPainel Das ConferênciasVerifique VoicemailVive A ChamadaPainel PrincipalLinhas Ativas PainelPainel Das ConferênciasVerifique VoicemailVive A Chamada
diff --git a/agc_2-X/trunk/LANG_www/agc_pt/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_pt/call_log_display.php index 5da9fe51..dc59b56f 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/call_log_display.php @@ -27,6 +27,7 @@ # 50711-1202 - removed HTTP authentication in favor of user/pass vars # 60323-1550 - added option for showing different number dialed in log # 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1202 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -47,6 +48,9 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($in_limit)) {$in_limit="100";} @@ -54,8 +58,8 @@ if (!isset($out_limit)) {$out_limit="100";} $number_dialed = 'number_dialed'; #$number_dialed = 'extension'; -$version = '0.0.7'; -$build = '60421-1401'; +$version = '0.0.8'; +$build = '60619-1202'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_pt/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_pt/conf_exten_check.php index 51b67358..14665527 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/conf_exten_check.php @@ -31,6 +31,7 @@ # 51121-1353 - Altered echo statements for several small PHP speed optimizations # 60410-1424 - Added ability to grab calls-being-placed and agent status # 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1201 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -59,13 +60,16 @@ if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level" if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.8'; -$build = '60421-1405'; +$version = '0.0.9'; +$build = '60619-1201'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_pt/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_pt/inbound_popup.php index 16abb2a8..b9ed7470 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/inbound_popup.php @@ -29,6 +29,7 @@ # 50503-1244 - added session_name checking for extra security # 50711-1203 - removed HTTP authentication in favor of user/pass vars # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -61,12 +62,14 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.5'; -$build = '60421-1043'; +$version = '0.0.6'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_pt/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_pt/live_exten_check.php index ef528784..5a7a69d6 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/live_exten_check.php @@ -27,6 +27,8 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form +# 60825-1029 - Fixed translation variable issue ChannelA # require("dbconnect.php"); @@ -51,11 +53,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '1.1.11'; -$build = '60421-1359'; +$version = '2.0.1'; +$build = '60825-1029'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -141,8 +146,8 @@ echo "$row[0]|"; { $loop_count++; $row=mysql_fetch_row($rslt); - $CanaletaA[$loop_count] = "$row[0]"; - $CanaletaB[$loop_count] = "$row[1]"; + $ChanneLA[$loop_count] = "$row[0]"; + $ChanneLB[$loop_count] = "$row[1]"; if ($format=='debug') {echo "\n";} } } @@ -151,7 +156,7 @@ echo "$row[0]|"; while($loop_count > $counter) { $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -159,13 +164,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; + echo "CanaletaA: $ChanneLA[$counter] ~"; + echo "CanaletaB: $ChanneLB[$counter] ~"; echo "CanaletaBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -173,13 +178,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; + echo "CanaletaA: $ChanneLA[$counter] ~"; + echo "CanaletaB: $ChanneLB[$counter] ~"; echo "CanaletaBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -187,13 +192,13 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; + echo "CanaletaA: $ChanneLA[$counter] ~"; + echo "CanaletaB: $ChanneLB[$counter] ~"; echo "CanaletaBtrunk: $row[0]|"; } else { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; + $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$trunk_count = mysql_num_rows($rslt);} @@ -201,16 +206,16 @@ echo "$row[0]|"; { $row=mysql_fetch_row($rslt); echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; + echo "CanaletaA: $ChanneLA[$counter] ~"; + echo "CanaletaB: $ChanneLB[$counter] ~"; echo "CanaletaBtrunk: $row[0]|"; } else { echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $CanaletaA[$counter]|"; + echo "CanaletaA: $ChanneLA[$counter] ~"; + echo "CanaletaB: $ChanneLB[$counter] ~"; + echo "CanaletaBtrunk: $ChanneLA[$counter]|"; } } } diff --git a/agc_2-X/trunk/LANG_www/agc_pt/manager_send.php b/agc_2-X/trunk/LANG_www/agc_pt/manager_send.php index a1309814..343bd6ad 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/manager_send.php @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -58,6 +58,8 @@ # 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD # 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function # 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1158 - Added variable filters to close security holes for login form +# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers # require("dbconnect.php"); @@ -111,14 +113,22 @@ if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"]; elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); +$secondS = ereg_replace("[^0-9]","",$secondS); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($format)) {$format="alert";} if (!isset($ext_priority)) {$ext_priority="1";} -$version = '0.0.23'; -$build = '60421-1413'; +$version = '0.0.25'; +$build = '60809-1544'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -391,7 +401,7 @@ if ($ACTION=="Hangup") ###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD +# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD, RedirectXtra, RedirectXtraCX # - insert Redirect Manager statement using extensions name ###################### if ($ACTION=="RedirectVD") @@ -542,6 +552,115 @@ if ($ACTION=="RedirectNameVmail") } } +if ($ACTION=="RedirectXtraCX") +{ + $row=''; $rowx=''; + $channel_liveX=1; + $channel_liveY=1; + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) + { + $channel_liveX=0; + $channel_liveY=0; + echo "Uma destas variáveis é inválido:\n"; + echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; + echo "ExtraCanaleta $extrachannel deve ser mais grande de 2 caráteres\n"; + echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; + echo "exten $exten deve ser ajustado\n"; + echo "ext_context $ext_context deve ser ajustado\n"; + echo "ext_priority $ext_priority deve ser ajustado\n"; + echo "\nRedirect Action não emitido\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canaleta $channel não está vivo em $call_server_ip, Redirect comando não introduzido\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canaleta $channel não está vivo em $server_ip, Redirect comando não introduzido\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0] < 1) + { + $channel_liveY=0; + echo "No Local agent to send call to, Redirect comando não introduzido\n"; + } + else + { + $stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + $dest_server_ip = $rowx[0]; + $dest_session_id = $rowx[1]; + $dest_user = $rowx[2]; + $S='*'; + + $D_s_ip = explode('.', $dest_server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id$S$lead_id$S$dest_user$S$phone_code$S$phone_number$S$campaign$S"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + + echo "RedirectXtraCX comando emitido para Canaleta $channel em $call_server_ip and \nHungup $extrachannel em $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_pt/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_pt/park_calls_display.php index 620cff28..40317dfd 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/park_calls_display.php @@ -21,6 +21,7 @@ # 50524-1515 - First build of script # 50711-1208 - removed HTTP authentication in favor of user/pass vars # 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1205 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -41,12 +42,15 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($park_limit)) {$park_limit="1000";} -$version = '0.0.3'; -$build = '60421-1111'; +$version = '0.0.4'; +$build = '60619-1205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/agc_pt/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_pt/vdc_db_query.php index 560d8537..8d172e39 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/vdc_db_query.php @@ -67,6 +67,8 @@ # - $recipient - ('ANYONE,'USERONLY') # - $callback_id - ('12345','12346',...) # - $use_internal_dnc - ('Y','N') +# - $omit_phone_code - ('Y','N') +# - $no_delete_sessions - ('0','1') # changes # 50629-1044 - First build of script @@ -104,10 +106,11 @@ # 60609-1148 - Added ability to check for manual dial numbers in DNC # 60619-1117 - Added variable filters to close security holes for login form # 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# +# 60821-1600 - Added ability to omit the phone code on vicidial lead dialing +# 60821-1647 - Added ability to not delete sessions at logout -$version = '0.0.34'; -$build = '60623-1414'; +$version = '2.0.36'; +$build = '60821-1647'; require("dbconnect.php"); @@ -232,6 +235,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -372,7 +377,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -534,9 +539,14 @@ if ($ACTION == 'manDiaLnextCaLL') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -653,9 +663,14 @@ if ($ACTION == 'manDiaLonly') if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} else {$CIDstring = "$MqueryCID";} + ### whether to omit phone_code or not + if (eregi('Y',$omit_phone_code)) + {$Ndialstring = "$Local_out_prefix$phone_number";} + else + {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} ### insert the call action into the vicidial_manager table to initiate the call # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -943,6 +958,46 @@ if ($stage == "end") } +################################################################################ +### VDADREcheckINCOMING - for auto-dial VICIDiaL dialing this will recheck for +### calls to see if the channel has updated +################################################################################ +if ($ACTION == 'VDADREcheckINCOMING') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) || (strlen($lead_id)<1) ) + { + $channel_live=0; + echo "0\n"; + echo "Campanha $campaign é inválido\n"; + echo "lead_id $lead_id é inválido\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $queue_leadID_ct = mysql_num_rows($rslt); + + if ($queue_leadID_ct > 0) + { + $row=mysql_fetch_row($rslt); + $lead_id =$row[0]; + $uniqueid =$row[1]; + $callerid =$row[2]; + $channel =$row[3]; + $call_server_ip =$row[4]; + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + } + } +} + + ################################################################################ ### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls ### in the vicidial_live_agents table in QUEUE status, then @@ -1183,7 +1238,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### If CHAMADABK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHVELHO", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -1220,11 +1275,14 @@ else $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); - ##### Remove the reservation em the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation em the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; diff --git a/agc_2-X/trunk/LANG_www/agc_pt/vicidial.php b/agc_2-X/trunk/LANG_www/agc_pt/vicidial.php index 84bd2e68..091dbeed 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/vicidial.php @@ -112,6 +112,18 @@ # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build +# 60808-1145 - Added consultative transfers with customer data +# 60808-2232 - Added campaign name to pulldown for login screen +# 60809-1603 - Added option to locally transfer consult xfers +# 60809-1732 - Added recheck of transferred channels before customer gone mesg +# 60810-1011 - Fixed CXFER leave 3way call bugs +# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay +# 60816-1716 - Fixed customer time display bug and client DST setting +# 60821-1555 - Added option to omit phone_code on dialout of leads +# 60821-1628 - Added ALLFORCE recording option +# 60821-1643 - Added no_delete_sessions option to not delete sessions +# 60822-0512 - Changed phone number fields to be maxlength of 12 +# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # require("dbconnect.php"); @@ -157,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) { @@ -166,6 +178,7 @@ if ($force_logout) exit; } +$isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); @@ -174,6 +187,7 @@ $CIDdate = date("ymdHis"); $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); + $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently @@ -186,6 +200,11 @@ $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $agentcallsstatus = '0'; # set to 1 to show agent status and call count $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats +$show_campname_pulldown = '1'; # set to 1 to show campaign name em login pulldown +$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL +$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server +$clientDST = '1'; # set to 1 to check for DST em server for agent time +$no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -223,7 +242,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +284,7 @@ echo "\n"; echo "
English Português
\n"; echo "
\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -300,7 +323,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1509,7 +1539,7 @@ if ($ADD==41) { 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';"; + $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', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); } } @@ -1537,10 +1567,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Re-Início de uma sessão
\n"; #echo "\n"; echo "

Início de uma sessão Do Usuário

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -338,7 +361,7 @@ echo "\n";echo "\n"; echo "
Início de uma sessão Da Campanha
English Português
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -375,7 +398,7 @@ echo "\n"; echo "\n";echo "\n";echo "
Início de uma sessão
English Português
\n"; echo "\n"; echo "\n"; -echo "


"; +echo "


"; echo ""; echo ""; echo "\n"; @@ -394,7 +417,8 @@ exit; } else { -$fp = fopen ("./vicidial_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) + {$fp = fopen ("./vicidial_auth_entries.txt", "a");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) @@ -427,9 +451,11 @@ $VDloginDISPLAY=0; $VU_vicidial_recording=$row[7]; $VU_vicidial_transfers=$row[8]; $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} @@ -513,7 +539,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -547,6 +573,8 @@ $VDloginDISPLAY=0; $wrapup_message=$row[27]; $closer_campaigns=$row[28]; $use_internal_dnc=$row[29]; + $allcalls_delay=$row[30]; + $omit_phone_code=$row[31]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -597,8 +625,11 @@ $VDloginDISPLAY=0; } else { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); + fclose($fp); + } $VDloginDISPLAY=1; $VDdisplayMESSAGE = "O início de uma sessão incorreto, tenta por favor outra vez
"; } @@ -616,7 +647,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1287,10 +1314,13 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "
Início de uma sessão Do Telefone
\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; - echo ""; + echo "
"; echo ""; echo ""; echo "\n"; @@ -655,7 +686,7 @@ echo " - + @@ -5102,28 +5292,28 @@ Seu Status:
Calls Dialing: @@ -5308,7 +5498,7 @@ Seu Status:
Calls Dialing: @@ -5372,7 +5562,7 @@ ID REGISTRO:
- + @@ -5400,7 +5590,7 @@ else
Início de uma sessão Da Campanha
\n"; echo "\n"; echo "\n"; - echo "


"; + echo "


"; echo ""; echo ""; echo "\n"; @@ -740,6 +771,10 @@ else $DBX_pass=$row[58]; $DBX_port=$row[59]; + if ($clientDST) + { + $local_gmt = ($local_gmt + $isdst); + } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; @@ -795,6 +830,11 @@ else $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; + if ($webform_sessionname) + {$webform_sessionname = "&session_name=$session_name";} + else + {$webform_sessionname = '';} + $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1000,8 +1040,8 @@ $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); +$Cmonths = Array('Janeiro','February','Março','Abril','Pode','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'); $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $CCAL_OUT = ''; @@ -1313,6 +1353,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var all_record_count = 0; var LeaDDispO = ''; var LeaDPreVDispO = ''; var AgaiNHanguPChanneL = ''; @@ -1320,8 +1361,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; - var agentcallsstatus = ''; - var campagentstatctmax = ''; + var agentcallsstatus = '' + var campagentstatctmax = '' var campagentstatct = '0'; var manual_dial_in_progress = 0; var auto_dial_alt_dial = 0; @@ -1339,61 +1380,66 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var wrapup_message = ''; var wrapup_counter = 0; var wrapup_waiting = 0; - var use_internal_dnc = '' - var DiaLControl_auto_HTML = "\"Pausa\"\"Resumo\""; - var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Resumo\""; - var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Resumo\""; - var DiaLControl_manual_HTML = "\"Número"; + var use_internal_dnc = ''; + var allcalls_delay = ''; + var omit_phone_code = ''; + var no_delete_sessions = ''; + var webform_session = ''; + var local_consult_xfers = ''; + var DiaLControl_auto_HTML = "\"Pausa\"\"Resumo\""; + var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Resumo\""; + var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Resumo\""; + var DiaLControl_manual_HTML = "\"Número"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; var image_livecall_OFF = new Image(); - image_livecall_OFF.src="../agc/images/agc_live_call_OFF_pt.gif"; + image_livecall_OFF.src="../agc/images/agc_live_call_OFF.gif"; var image_livecall_ON = new Image(); - image_livecall_ON.src="../agc/images/agc_live_call_ON_pt.gif"; + image_livecall_ON.src="../agc/images/agc_live_call_ON.gif"; var image_LB_dialnextnumber = new Image(); - image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber_pt.gif"; + image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber.gif"; var image_LB_hangupcustomer = new Image(); - image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer_pt.gif"; + image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer.gif"; var image_LB_transferconf = new Image(); - image_LB_transferconf.src="../agc/images/vdc_LB_transferconf_pt.gif"; + image_LB_transferconf.src="../agc/images/vdc_LB_transferconf.gif"; var image_LB_grabparkedcall = new Image(); - image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall_pt.gif"; + image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall.gif"; var image_LB_parkcall = new Image(); - image_LB_parkcall.src="../agc/images/vdc_LB_parkcall_pt.gif"; + image_LB_parkcall.src="../agc/images/vdc_LB_parkcall.gif"; var image_LB_webform = new Image(); - image_LB_webform.src="../agc/images/vdc_LB_webform_pt.gif"; + image_LB_webform.src="../agc/images/vdc_LB_webform.gif"; var image_LB_stoprecording = new Image(); - image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording_pt.gif"; + image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording.gif"; var image_LB_startrecording = new Image(); - image_LB_startrecording.src="../agc/images/vdc_LB_startrecording_pt.gif"; + image_LB_startrecording.src="../agc/images/vdc_LB_startrecording.gif"; var image_LB_pause = new Image(); - image_LB_pause.src="../agc/images/vdc_LB_pause_pt.gif"; + image_LB_pause.src="../agc/images/vdc_LB_pause.gif"; var image_LB_resume = new Image(); - image_LB_resume.src="../agc/images/vdc_LB_resume_pt.gif"; + image_LB_resume.src="../agc/images/vdc_LB_resume.gif"; var image_LB_senddtmf = new Image(); - image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf_pt.gif"; + image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf.gif"; var image_LB_dialnextnumber_OFF = new Image(); - image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF_pt.gif"; + image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF.gif"; var image_LB_hangupcustomer_OFF = new Image(); - image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF_pt.gif"; + image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF.gif"; var image_LB_transferconf_OFF = new Image(); - image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF_pt.gif"; + image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF.gif"; var image_LB_grabparkedcall_OFF = new Image(); image_LB_grabparkedcall_OFF.src="../agc/images/vdc_LB_grabparkedcall_OFF.gif"; var image_LB_parkcall_OFF = new Image(); - image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF_pt.gif"; + image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF.gif"; var image_LB_webform_OFF = new Image(); - image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF_pt.gif"; + image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF.gif"; var image_LB_stoprecording_OFF = new Image(); image_LB_stoprecording_OFF.src="../agc/images/vdc_LB_stoprecording_OFF.gif"; var image_LB_startrecording_OFF = new Image(); image_LB_startrecording_OFF.src="../agc/images/vdc_LB_startrecording_OFF.gif"; var image_LB_pause_OFF = new Image(); - image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF_pt.gif"; + image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF.gif"; var image_LB_resume_OFF = new Image(); - image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF_pt.gif"; + image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF.gif"; var image_LB_senddtmf_OFF = new Image(); - image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF_pt.gif"; + image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF.gif"; @@ -1480,18 +1526,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); } - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (manual_string.match(regXFvars)) { - if (manual_string.length=='11') - {manual_string = "9" + manual_string;} - else + var donothing=1; + } + else + { + if (document.vicidial_form.xferoverride.checked==false) { - if (manual_string.length=='10') - {manual_string = "91" + manual_string;} + if (manual_string.length=='11') + {manual_string = "9" + manual_string;} else { - if (manual_string.length=='7') - {manual_string = "9" + manual_string;} + if (manual_string.length=='10') + {manual_string = "91" + manual_string;} + else + { + if (manual_string.length=='7') + {manual_string = "9" + manual_string;} + } } } } @@ -1527,8 +1581,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttp = new XMLHttpRequest(); } if (xmlhttp) - { - + { + var regCXFvars = new RegExp("CXFER","g"); + var tasknum_string = tasknum.toString(); + if (tasknum_string.match(regCXFvars)) + { + var Ctasknum = tasknum_string.replace(regCXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '990009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + } + var regAXFvars = new RegExp("AXFER","g"); + if (tasknum_string.match(regAXFvars)) + { + var Ctasknum = tasknum_string.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } if (taskprefix == 'NO') {var orig_prefix = '';} else {var orig_prefix = agc_dial_prefix;} if (taskreverse == 'YES') @@ -1572,7 +1646,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; XDcheck = 'YES'; - // document.getElementById("HangupXferLine").innerHTML ="\"Linha"; + // document.getElementById("HangupXferLine").innerHTML ="\"Linha"; } } } @@ -1848,16 +1922,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // filename = filedate + "_" + user_abb; var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Pare"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Pare"; + + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Comece"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } if (taskconfrectype == 'StopMonitorConf') { filename = taskconffile; var query_recording_exten = session_id; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Comece"; - document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + var conf_rec_start_html = "\"Comece"; + if (campaign_recording == 'ALLFORCE') + { + document.getElementById("RecorDControl").innerHTML = "\"Comece"; + } + else + { + document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; + } } confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); @@ -1927,18 +2016,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var queryCID = "XBvdcW" + epoch_sec + user_abb; var blindxferdialstring = document.vicidial_form.xfernumber.value; - if (document.vicidial_form.xferoverride.checked==false) + var regXFvars = new RegExp("XFER","g"); + if (blindxferdialstring.match(regXFvars)) { - if (blindxferdialstring.length=='11') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} - else + var regAXFvars = new RegExp("AXFER","g"); + if (blindxferdialstring.match(regAXFvars)) { - if (blindxferdialstring.length=='10') - {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); + if (Ctasknum.length < 2) + {Ctasknum = '83009';} + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + if (closerxfercamptail.length < 3) + {closerxfercamptail = 'IVR';} + blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; + } + } + else + { + if (document.vicidial_form.xferoverride.checked==false) + { + if (blindxferdialstring.length=='11') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} else { - if (blindxferdialstring.length=='7') - {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + if (blindxferdialstring.length=='10') + {blindxferdialstring = dial_prefix + "1" + blindxferdialstring;} + else + { + if (blindxferdialstring.length=='7') + {blindxferdialstring = dial_prefix + "" + blindxferdialstring;} + } } } } @@ -1996,7 +2103,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var queryCID = "VXvdcW" + epoch_sec + user_abb; var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue; + var redirecttype_test = document.vicidial_form.xfernumber.value; + var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var regRXFvars = new RegExp("CXFER","g"); + if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) + {var redirecttype = 'RedirectXtraCX';} + else + {var redirecttype = 'RedirectXtra';} + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&campaign=CL_" + campaign + '' + closerxfercamptail; } if (taskvar == 'ParK') { @@ -2006,7 +2120,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var parkedby = protocol + "/" + extension; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby; - document.getElementById("ParkControl").innerHTML ="\"Chamada"; + document.getElementById("ParkControl").innerHTML ="\"Chamada"; customerparked=1; } if (taskvar == 'FROMParK') @@ -2027,7 +2141,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1"; - document.getElementById("ParkControl").innerHTML ="\"Chamada"; + document.getElementById("ParkControl").innerHTML ="\"Chamada"; customerparked=0; } @@ -2135,8 +2249,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // alert("VICISELETOR Call log entered:\n" + document.vicidial_form.uniqueid.value); if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) ) { - var conf_rec_start_html = "\"Comece"; - if (campaign_recording == 'NEVER') + var conf_rec_start_html = "\"Comece"; + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Comece"; } @@ -2447,15 +2561,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Ó partido chamado: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck; - document.getElementById("Leave3WayCall").innerHTML ="\"CHAMADA"; + document.getElementById("Leave3WayCall").innerHTML ="\"CHAMADA"; - document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; + document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Seletor"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Seletor"; - document.getElementById("HangupXferLine").innerHTML ="\"Linha"; + document.getElementById("HangupXferLine").innerHTML ="\"Linha"; - document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; xferchannellive=1; XDcheck = ''; @@ -2486,17 +2600,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=0; document.getElementById("MainStatuSSpan").innerHTML = " Chamado: " + lead_dial_number + " UID: " + CIDcheck + "  "; - document.getElementById("ParkControl").innerHTML ="\"Chamada"; + document.getElementById("ParkControl").innerHTML ="\"Chamada"; - document.getElementById("HangupControl").innerHTML = "\"Cliente"; + document.getElementById("HangupControl").innerHTML = "\"Cliente"; - document.getElementById("XferControl").innerHTML = "\"Transferência"; + document.getElementById("XferControl").innerHTML = "\"Transferência"; - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"MAIS"; + document.getElementById("InternalCloser").innerHTML = "\"MAIS"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -2527,7 +2641,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE) { all_record = 'NO'; - document.getElementById("DiaLControl").innerHTML = "\"Número"; + all_record_count=0; + document.getElementById("DiaLControl").innerHTML = "\"Número"; if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; @@ -2562,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2663,7 +2778,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; // $VICISELETOR_web_QUERY_STRING =~ s/ /+/gi; // $VICISELETOR_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2688,7 +2804,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; if (document.vicidial_form.LeadPreview.checked==false) { @@ -2696,9 +2812,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("HangupControl").innerHTML = "\"Cliente"; + document.getElementById("HangupControl").innerHTML = "\"Cliente"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2745,7 +2861,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Número"; + document.getElementById("DiaLControl").innerHTML = "\"Número"; var xmlhttp=false; /*@cc_on @*/ @@ -2822,7 +2938,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go em to next lead"; - document.getElementById("DiaLControl").innerHTML = "\"Número"; + document.getElementById("DiaLControl").innerHTML = "\"Número"; } } } @@ -2837,6 +2953,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function ManualDialOnly(taskaltnum) { all_record = 'NO'; + all_record_count=0; if (taskaltnum == 'ALTTelefoneE') { var manDiaLonly_num = document.vicidial_form.alt_phone.value; @@ -2876,7 +2993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -2901,9 +3018,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + manDiaLonly_num + " UID: " + MDnextCID + "   Anel de espera..."; - document.getElementById("HangupControl").innerHTML = "\"Cliente"; + document.getElementById("HangupControl").innerHTML = "\"Cliente"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (campaign_script.length > 0) ) @@ -2999,11 +3116,75 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } + +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function ReChecKCustoMerChaN() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(recheckVDAI_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + var recheck_incoming = null; + recheck_incoming = xmlhttp.responseText; + // alert(xmlhttp.responseText); + var recheck_VDIC_array=recheck_incoming.split("\n"); + if (recheck_VDIC_array[0] == '1') + { + var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|"); + if (reVDIC_data_VDAC[3] == lastcustchannel) + { + // do nothing + } + else + { + // alert("Canaleta has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]); + document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3]; + lastcustchannel = reVDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4]; + lastcustserverip = reVDIC_data_VDAC[4]; + custchannellive = 1; + } + } + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { all_record = 'NO'; + all_record_count=0; document.vicidial_form.lead_id.value = ''; var xmlhttp=false; /*@cc_on @*/ @@ -3132,17 +3313,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } - document.getElementById("ParkControl").innerHTML ="\"Chamada"; + document.getElementById("ParkControl").innerHTML ="\"Chamada"; - document.getElementById("HangupControl").innerHTML = "\"Cliente"; + document.getElementById("HangupControl").innerHTML = "\"Cliente"; - document.getElementById("XferControl").innerHTML = "\"Transferência"; + document.getElementById("XferControl").innerHTML = "\"Transferência"; - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"MAIS"; + document.getElementById("InternalCloser").innerHTML = "\"MAIS"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3197,7 +3378,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3211,9 +3393,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; - if (campaign_recording == 'ALLCALLS') + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) {all_record = 'YES';} if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) @@ -3303,7 +3485,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO; + "&dispo=" + LeaDDispO + '' + + webform_session; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -3320,11 +3503,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; } } @@ -3479,13 +3662,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip=''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - document.getElementById("WebFormSpan").innerHTML = "\"Formulário"; - document.getElementById("ParkControl").innerHTML = "\"Chamada"; - document.getElementById("HangupControl").innerHTML = "\"Cliente"; - document.getElementById("XferControl").innerHTML = "\"Transferência"; - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"MAIS"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário"; + document.getElementById("ParkControl").innerHTML = "\"Chamada"; + document.getElementById("HangupControl").innerHTML = "\"Cliente"; + document.getElementById("XferControl").innerHTML = "\"Transferência"; + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + document.getElementById("InternalCloser").innerHTML = "\"MAIS"; + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.vicidial_form.custdatetime.value = ''; @@ -3498,7 +3681,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - document.getElementById("DiaLControl").innerHTML = "\"Número"; + document.getElementById("DiaLControl").innerHTML = "\"Número"; reselect_alt_dial = 0; } } @@ -3591,15 +3774,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xferchannel.value = ""; lastxferchannel=''; - document.getElementById("Leave3WayCall").innerHTML ="\"CHAMADA"; + document.getElementById("Leave3WayCall").innerHTML ="\"CHAMADA"; - document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; + document.getElementById("DialWithCustomer").innerHTML ="\"Seletor"; - document.getElementById("ParkCustomerDial").innerHTML ="\"Seletor"; + document.getElementById("ParkCustomerDial").innerHTML ="\"Seletor"; - document.getElementById("HangupXferLine").innerHTML ="\"Linha"; + document.getElementById("HangupXferLine").innerHTML ="\"Linha"; - document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; + document.getElementById("HangupBothLines").innerHTML ="\"Hangup"; } } @@ -4174,7 +4357,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol; + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&no_delete_sessions=" + no_delete_sessions; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VDlogout_query); @@ -4487,7 +4670,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.LeadLookuP.checked=true; document.getElementById("sessionIDspan").innerHTML = session_id; - if (campaign_recording == 'NEVER') + if ( (campaign_recording == 'NEVER') || (campaign_recording == 'ALLFORCE') ) { document.getElementById("RecorDControl").innerHTML = "\"Comece"; } @@ -4531,7 +4714,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (document.vicidial_form.DiaLAltPhonE.checked==true) { reselect_alt_dial = 1; - document.getElementById("DiaLControl").innerHTML = "\"Número"; + document.getElementById("DiaLControl").innerHTML = "\"Número"; document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call"; } @@ -4548,6 +4731,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} + if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();} if (wrapup_segundos > 0) { @@ -4632,8 +4816,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (all_record == 'YES') { - conf_send_recording('MonitorConf',session_id ,''); - all_record = 'NO'; + if (all_record_count < allcalls_delay) + {all_record_count++;} + else + { + conf_send_recording('MonitorConf',session_id ,''); + all_record = 'NO'; + all_record_count=0; + } } @@ -4893,13 +5083,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('HotKeyEntriesBox'); hot_keys_active = 1; - document.getElementById("hotkeysdisplay").innerHTML = "\"CHAVES"; + document.getElementById("hotkeysdisplay").innerHTML = "\"CHAVES"; } else { hideDiv('HotKeyEntriesBox'); hot_keys_active = 0; - document.getElementById("hotkeysdisplay").innerHTML = "\"CHAVES"; + document.getElementById("hotkeysdisplay").innerHTML = "\"CHAVES"; } } @@ -4911,7 +5101,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { HKbutton_allowed = 0; showDiv('TransferMain'); - document.getElementById("XferControl").innerHTML = "\"Transferência"; + document.getElementById("XferControl").innerHTML = "\"Transferência"; } else { @@ -4919,7 +5109,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('TransferMain'); if (showoffvar == 'YES') { - document.getElementById("XferControl").innerHTML = "\"Transferência"; + document.getElementById("XferControl").innerHTML = "\"Transferência"; } } } @@ -5029,7 +5219,7 @@ echo "\n"; - +
Início de uma sessão Error
VICISELETOR SCRIPT   LIVE     sessão ID: Vive A ChamadaVive A Chamada
@@ -5073,7 +5263,7 @@ echo "\n";
  (Este é geralmente um 1 nos EUA e no Canadá)
Telefone Number:   (máximo de 10 dígitos - dígitos somente)  (12 digits max - digits only)
Ligações Existentes Da Busca:   (Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova)
- Transferência - Conferência
- MAIS PRÓXIMO INTERNO - LOCAL MAIS PRÓXIMO + Transferência - Conferência
+ MAIS PRÓXIMO INTERNO + LOCAL MAIS PRÓXIMO CODE - Linha De Xfer Do Hangup - Hangup Ambas as Linhas + Linha De Xfer Do Hangup + Hangup Ambas as Linhas
- Número a chamar-se   - segundos   - channel + Número a chamar-se   + segundos   + channel OVERRIDE   D1 D2
- Seletor Com Cliente - Seletor Do Cliente Do Parque - CHAMADA DA LICENÇA 3-WAY - Transferência Da Cortina Do Seletor + Seletor Com Cliente + Seletor Do Cliente Do Parque + CHAMADA DA LICENÇA 3-WAY + Transferência Da Cortina Do Seletor Blind Transfer VMail Message
-Número Seguinte Do Seletor
+Número Seguinte Do Seletor
INSPECÇÃO PRÉVIA DA LIGAÇÃO
ALT DO TELEFONE
@@ -5327,16 +5517,16 @@ LIMA DE GRAVAÇÃO:
ID REGISTRO:
-Comece Gravar
+Comece Gravar

-Formulário Da Correia fotorreceptora
+Formulário Da Correia fotorreceptora

-Chamada Do Parque
-Transferência - Conferência
+Chamada Do Parque
+Transferência - Conferência

-Cliente Do Hangup
+Cliente Do Hangup

-Emita DTMF
+Emita DTMF
  Vendedor Id:
Telefone:   DialCode:   Alt. Telefone:   DialCode:   Alt. Telefone:
Mostra:   Email:
diff --git a/agc_2-X/trunk/LANG_www/agc_pt/voicemail_check.php b/agc_2-X/trunk/LANG_www/agc_pt/voicemail_check.php index b12b1a83..5a03e14a 100644 --- a/agc_2-X/trunk/LANG_www/agc_pt/voicemail_check.php +++ b/agc_2-X/trunk/LANG_www/agc_pt/voicemail_check.php @@ -21,6 +21,7 @@ # 50503-1241 - added session_name checking for extra security # 50711-1201 - removed HTTP authentication in favor of user/pass vars # 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1204 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -39,11 +40,14 @@ if (isset($_GET["format"])) {$format=$_GET["format"];} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} +$user=ereg_replace("[^0-9a-zA-Z]","",$user); +$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + # default optional vars if not set if (!isset($format)) {$format="text";} -$version = '0.0.4'; -$build = '60421-1147'; +$version = '0.0.5'; +$build = '60619-1204'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/LANG_www/astguiclient/admin.php b/agc_2-X/trunk/LANG_www/astguiclient/admin.php index 75f407c7..74b6b0e1 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient/admin.php +++ b/agc_2-X/trunk/LANG_www/astguiclient/admin.php @@ -15,10 +15,13 @@ # 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60427-1137 - Fixed phone search bug # 60620-1243 - Added variable filtering to eliminate SQL injection attack threat +# 60814-1402 - Added off-hour gmt values (India, Australia, etc...) +# 60814-1540 - Added system performance logging and script logging options +# 60815-1016 - Added agi output option # -$version = '1.1.12'; -$build = '60620-1243'; +$version = '2.0.1'; +$build = '60815-1016'; require("dbconnect.php"); @@ -197,6 +200,12 @@ 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 (isset($_GET["sys_perf_log"])) {$sys_perf_log=$_GET["sys_perf_log"];} + elseif (isset($_POST["sys_perf_log"])) {$sys_perf_log=$_POST["sys_perf_log"];} +if (isset($_GET["vd_server_logs"])) {$vd_server_logs=$_GET["vd_server_logs"];} + elseif (isset($_POST["vd_server_logs"])) {$vd_server_logs=$_POST["vd_server_logs"];} +if (isset($_GET["agi_output"])) {$agi_output=$_GET["agi_output"];} + elseif (isset($_POST["agi_output"])) {$agi_output=$_POST["agi_output"];} ##### BEGIN VARIABLE FILTERING FOR SECURITY ##### @@ -208,6 +217,8 @@ $computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); +$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); +$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); ### DIGITS ONLY ### $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); @@ -284,6 +295,7 @@ $server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); $old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); $ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); $CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); +$agi_output = ereg_replace("[^-\_0-9a-zA-Z]","",$agi_output); ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); @@ -856,6 +868,21 @@ echo "
Versão do correia-cliente de VICISELETOR:     CONFIGURAÇÃO:               Usuário:              
Mostre a informação da canaleta da chamada de conferência
0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -CHAVES QUENTES INATIVAS +CHAVES QUENTES INATIVAS
\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Default Context - The default dialplan context used for scripts that operate for this server. Default is 'default' +
+ +
+System Performance - Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N. + +
+
+
+Server Logs - Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y. + +
+
+
+AGI Output - Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE. +



@@ -944,7 +971,7 @@ echo "
Full Name: 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
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; @@ -1196,7 +1223,7 @@ echo "
Picture: 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
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
Manager Secret: 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
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
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; @@ -1421,7 +1451,7 @@ echo "
Picture: 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
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
Manager Secret: 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
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
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; diff --git a/agc_2-X/trunk/LANG_www/astguiclient/dbconnect.php b/agc_2-X/trunk/LANG_www/astguiclient/dbconnect.php index 1662f18f..d562e3dd 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/astguiclient/dbconnect.php @@ -1,15 +1,48 @@ - + LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); + +$local_DEF = 'Local/'; +$conf_silent_prefix = '7'; +$local_AMP = '@'; +$ext_context = 'demo'; +$recording_exten = '8309'; +$WeBRooTWritablE = '1'; + +?> diff --git a/agc_2-X/trunk/LANG_www/astguiclient_de/admin.php b/agc_2-X/trunk/LANG_www/astguiclient_de/admin.php index 1a98ea49..292e7fa3 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_de/admin.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_de/admin.php @@ -15,10 +15,13 @@ # 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60427-1137 - Fixed phone search bug # 60620-1243 - Added variable filtering to eliminate SQL injection attack threat +# 60814-1402 - Added off-hour gmt values (India, Australia, etc...) +# 60814-1540 - Added system performance logging and script logging options +# 60815-1016 - Added agi output option # -$version = '1.1.12'; -$build = '60620-1243'; +$version = '2.0.1'; +$build = '60815-1016'; require("dbconnect.php"); @@ -197,6 +200,12 @@ 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 (isset($_GET["sys_perf_log"])) {$sys_perf_log=$_GET["sys_perf_log"];} + elseif (isset($_POST["sys_perf_log"])) {$sys_perf_log=$_POST["sys_perf_log"];} +if (isset($_GET["vd_server_logs"])) {$vd_server_logs=$_GET["vd_server_logs"];} + elseif (isset($_POST["vd_server_logs"])) {$vd_server_logs=$_POST["vd_server_logs"];} +if (isset($_GET["agi_output"])) {$agi_output=$_GET["agi_output"];} + elseif (isset($_POST["agi_output"])) {$agi_output=$_POST["agi_output"];} ##### BEGIN VARIABLE FILTERING FOR SECURITY ##### @@ -208,6 +217,8 @@ $computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); +$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); +$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); ### DIGITS ONLY ### $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); @@ -284,6 +295,7 @@ $server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); $old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); $ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); $CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); +$agi_output = ereg_replace("[^-\_0-9a-zA-Z]","",$agi_output); ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); @@ -856,6 +868,21 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Rückstellung Kontext - Der Rückstellung dialplan Kontextverwendet für Indexe, die für diesen Bediener funktionieren.Rückstellung ist ' Rückstellung ' +
+ +
+System Performance - Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N. + +
+
+
+Server Logs - Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y. + +
+
+
+AGI Output - Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE. +



@@ -944,7 +971,7 @@ echo "
Voller Name: Firma:$NWB#phones-company$NWE
Abbildung:$NWB#phones-picture$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
\n"; @@ -1196,7 +1223,7 @@ echo "
Abbildung:Neue Anzeigen: $row[14]$NWB#phones-messages$NWE
Alte Anzeigen: $row[15]$NWB#phones-old_messages$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
Manager-LOGON: $NWB#phones-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Rückstellung Benutzer: $NWB#phones-login_user$NWE
Manager-Geheimnis: Manager-Update-Benutzer: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Hören Benutzer: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Senden Benutzer: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL ANZEIGE Verlängerung: $NWB#servers-answer_transfer_agent$NWE
Rückstellung Kontext: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; @@ -1421,7 +1451,7 @@ echo "
Abbildung:Neue Anzeigen: $row[14]$NWB#phones-messages$NWE
Alte Anzeigen: $row[15]$NWB#phones-old_messages$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
Manager-LOGON: $NWB#phones-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Rückstellung Benutzer: $NWB#phones-login_user$NWE
Manager-Geheimnis: Manager-Update-Benutzer: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Hören Benutzer: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Senden Benutzer: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL ANZEIGE Verlängerung: $NWB#servers-answer_transfer_agent$NWE
Rückstellung Kontext: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; diff --git a/agc_2-X/trunk/LANG_www/astguiclient_de/dbconnect.php b/agc_2-X/trunk/LANG_www/astguiclient_de/dbconnect.php index 1662f18f..d562e3dd 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_de/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_de/dbconnect.php @@ -1,15 +1,48 @@ - + LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); + +$local_DEF = 'Local/'; +$conf_silent_prefix = '7'; +$local_AMP = '@'; +$ext_context = 'demo'; +$recording_exten = '8309'; +$WeBRooTWritablE = '1'; + +?> diff --git a/agc_2-X/trunk/LANG_www/astguiclient_el/admin.php b/agc_2-X/trunk/LANG_www/astguiclient_el/admin.php index d332d0f6..ca780e51 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_el/admin.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_el/admin.php @@ -15,10 +15,13 @@ # 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60427-1137 - Fixed phone search bug # 60620-1243 - Added variable filtering to eliminate SQL injection attack threat +# 60814-1402 - Added off-hour gmt values (India, Australia, etc...) +# 60814-1540 - Added system performance logging and script logging options +# 60815-1016 - Added agi output option # -$version = '1.1.12'; -$build = '60620-1243'; +$version = '2.0.1'; +$build = '60815-1016'; require("dbconnect.php"); @@ -197,6 +200,12 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} +if (isset($_GET["sys_perf_log"])) {$sys_perf_log=$_GET["sys_perf_log"];} + elseif (isset($_POST["sys_perf_log"])) {$sys_perf_log=$_POST["sys_perf_log"];} +if (isset($_GET["vd_server_logs"])) {$vd_server_logs=$_GET["vd_server_logs"];} + elseif (isset($_POST["vd_server_logs"])) {$vd_server_logs=$_POST["vd_server_logs"];} +if (isset($_GET["agi_output"])) {$agi_output=$_GET["agi_output"];} + elseif (isset($_POST["agi_output"])) {$agi_output=$_POST["agi_output"];} ##### BEGIN VARIABLE FILTERING FOR SECURITY ##### @@ -208,6 +217,8 @@ $computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); +$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); +$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); ### DIGITS ONLY ### $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); @@ -284,6 +295,7 @@ $server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); $old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); $ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); $CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); +$agi_output = ereg_replace("[^-\_0-9a-zA-Z]","",$agi_output); ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); @@ -856,6 +868,21 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Προκαθορισμένο Περιεχόμενο - Το προκαθορισμένο περιεχόμενο του πλάνου κλήσεων για διεργασίες του διακομιστή. Το προκαθορισμένο είναι 'προκαθορισμένο' +
+ +
+System Performance - Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N. + +
+
+
+Server Logs - Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y. + +
+
+
+AGI Output - Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE. +



@@ -944,7 +971,7 @@ echo "
Πλήρες Ονομα: Εταιρία:$NWB#phones-company$NWE
Εικόνα:$NWB#phones-picture$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
\n"; @@ -1196,7 +1223,7 @@ echo "
Εικόνα:Νέα Μηνύματα: $row[14]$NWB#phones-messages$NWE
Παλαιά Μηνύματα: $row[15]$NWB#phones-old_messages$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
Διαχειριστή Σύνδεση: $NWB#phones-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Προκαθορισμένος Χρήστης: $NWB#phones-login_user$NWE
Κωδικός Διαχειριστή: echo "
Ενημέρωση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Παρακολούθηση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Αποστολή Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
VMail εσωτ.σύνδεση απόρριψης: $NWB#servers-voicemail_dump_exten$NWE
AD εσωτ.σύνδεση: $NWB#servers-answer_transfer_agent$NWE
Προκαθορισμένο Περιεχόμενο: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; @@ -1421,7 +1451,7 @@ echo "
Εικόνα:Νέα Μηνύματα: $row[14]$NWB#phones-messages$NWE
Παλαιά Μηνύματα: $row[15]$NWB#phones-old_messages$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
Διαχειριστή Σύνδεση: $NWB#phones-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Προκαθορισμένος Χρήστης: $NWB#phones-login_user$NWE
Κωδικός Διαχειριστή: echo "
Ενημέρωση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Παρακολούθηση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Αποστολή Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
VMail εσωτ.σύνδεση απόρριψης: $NWB#servers-voicemail_dump_exten$NWE
AD εσωτ.σύνδεση: $NWB#servers-answer_transfer_agent$NWE
Προκαθορισμένο Περιεχόμενο: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; diff --git a/agc_2-X/trunk/LANG_www/astguiclient_el/dbconnect.php b/agc_2-X/trunk/LANG_www/astguiclient_el/dbconnect.php index 1662f18f..d562e3dd 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_el/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_el/dbconnect.php @@ -1,15 +1,48 @@ - + LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); + +$local_DEF = 'Local/'; +$conf_silent_prefix = '7'; +$local_AMP = '@'; +$ext_context = 'demo'; +$recording_exten = '8309'; +$WeBRooTWritablE = '1'; + +?> diff --git a/agc_2-X/trunk/LANG_www/astguiclient_en/admin.php b/agc_2-X/trunk/LANG_www/astguiclient_en/admin.php index 654e9f12..74b6b0e1 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_en/admin.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_en/admin.php @@ -15,10 +15,13 @@ # 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60427-1137 - Fixed phone search bug # 60620-1243 - Added variable filtering to eliminate SQL injection attack threat +# 60814-1402 - Added off-hour gmt values (India, Australia, etc...) +# 60814-1540 - Added system performance logging and script logging options +# 60815-1016 - Added agi output option # -$version = '1.1.12'; -$build = '60620-1243'; +$version = '2.0.1'; +$build = '60815-1016'; require("dbconnect.php"); @@ -197,6 +200,12 @@ 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 (isset($_GET["sys_perf_log"])) {$sys_perf_log=$_GET["sys_perf_log"];} + elseif (isset($_POST["sys_perf_log"])) {$sys_perf_log=$_POST["sys_perf_log"];} +if (isset($_GET["vd_server_logs"])) {$vd_server_logs=$_GET["vd_server_logs"];} + elseif (isset($_POST["vd_server_logs"])) {$vd_server_logs=$_POST["vd_server_logs"];} +if (isset($_GET["agi_output"])) {$agi_output=$_GET["agi_output"];} + elseif (isset($_POST["agi_output"])) {$agi_output=$_POST["agi_output"];} ##### BEGIN VARIABLE FILTERING FOR SECURITY ##### @@ -208,6 +217,8 @@ $computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); +$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); +$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); ### DIGITS ONLY ### $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); @@ -284,6 +295,7 @@ $server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); $old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); $ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); $CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); +$agi_output = ereg_replace("[^-\_0-9a-zA-Z]","",$agi_output); ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); @@ -422,7 +434,7 @@ $browser = getenv("HTTP_USER_AGENT"); header ("Content-type: text/html; charset=utf-8"); $NWB = "   \"HELP\""; +$NWE = "')\">\"HELP\""; ###################### # ADD=99999 display the HELP SCREENS ###################### @@ -856,6 +868,21 @@ echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Default Context - The default dialplan context used for scripts that operate for this server. Default is 'default' +
+ +
+System Performance - Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N. + +
+
+
+Server Logs - Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y. + +
+
+
+AGI Output - Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE. +



@@ -944,7 +971,7 @@ echo "
Full Name: 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
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; @@ -1196,7 +1223,7 @@ echo "
Picture: 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
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
Manager Secret: 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
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
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; @@ -1421,7 +1451,7 @@ echo "
Picture: 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
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
Manager Secret: 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
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
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; diff --git a/agc_2-X/trunk/LANG_www/astguiclient_en/dbconnect.php b/agc_2-X/trunk/LANG_www/astguiclient_en/dbconnect.php index fb6d5917..d562e3dd 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_en/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_en/dbconnect.php @@ -1,16 +1,48 @@ - + LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); + +$local_DEF = 'Local/'; +$conf_silent_prefix = '7'; +$local_AMP = '@'; +$ext_context = 'demo'; +$recording_exten = '8309'; +$WeBRooTWritablE = '1'; + +?> diff --git a/agc_2-X/trunk/LANG_www/astguiclient_en/phone_stats.php b/agc_2-X/trunk/LANG_www/astguiclient_en/phone_stats.php index 8498746a..e1ff62d0 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_en/phone_stats.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_en/phone_stats.php @@ -121,7 +121,7 @@ echo "
\n"; - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' group by channel_group order by channel_group"; + $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by channel_group order by channel_group"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); # echo "|$stmt|\n"; @@ -160,7 +160,7 @@ echo "
CHANNEL GROUP COUNT $o++; } - $stmt="SELECT sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59'"; + $stmt="SELECT sum(length_in_sec) from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; $rslt=mysql_query($stmt, $link); $counts_to_print = mysql_num_rows($rslt); $row=mysql_fetch_row($rslt); @@ -184,7 +184,7 @@ echo "LAST 1000 CALLS FOR DATE RANGE:\n"; echo "\n"; echo "\n"; - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' LIMIT 1000"; + $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' LIMIT 1000"; $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); # echo "|$stmt|\n"; diff --git a/agc_2-X/trunk/LANG_www/astguiclient_en/remote_inbound.php b/agc_2-X/trunk/LANG_www/astguiclient_en/remote_inbound.php index 06642677..605fe83a 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_en/remote_inbound.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_en/remote_inbound.php @@ -4,6 +4,11 @@ ### Copyright (C) 2006 Matt Florell LICENSE: GPLv2 ### # the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) +# +# changes: +# 60620-1343 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# require("dbconnect.php"); @@ -13,6 +18,8 @@ $PHP_SELF=$_SERVER['PHP_SELF']; $submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} $SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $STARTtime = date("U"); $TODAY = date("Y-m-d"); diff --git a/agc_2-X/trunk/LANG_www/astguiclient_es/admin.php b/agc_2-X/trunk/LANG_www/astguiclient_es/admin.php index fcea423a..30b60009 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_es/admin.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_es/admin.php @@ -15,10 +15,13 @@ # 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60427-1137 - Fixed phone search bug # 60620-1243 - Added variable filtering to eliminate SQL injection attack threat +# 60814-1402 - Added off-hour gmt values (India, Australia, etc...) +# 60814-1540 - Added system performance logging and script logging options +# 60815-1016 - Added agi output option # -$version = '1.1.12'; -$build = '60620-1243'; +$version = '2.0.1'; +$build = '60815-1016'; require("dbconnect.php"); @@ -197,6 +200,12 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} +if (isset($_GET["sys_perf_log"])) {$sys_perf_log=$_GET["sys_perf_log"];} + elseif (isset($_POST["sys_perf_log"])) {$sys_perf_log=$_POST["sys_perf_log"];} +if (isset($_GET["vd_server_logs"])) {$vd_server_logs=$_GET["vd_server_logs"];} + elseif (isset($_POST["vd_server_logs"])) {$vd_server_logs=$_POST["vd_server_logs"];} +if (isset($_GET["agi_output"])) {$agi_output=$_GET["agi_output"];} + elseif (isset($_POST["agi_output"])) {$agi_output=$_POST["agi_output"];} ##### BEGIN VARIABLE FILTERING FOR SECURITY ##### @@ -208,6 +217,8 @@ $computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); +$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); +$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); ### DIGITS ONLY ### $dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); @@ -284,6 +295,7 @@ $server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); $old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); $ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); $CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); +$agi_output = ereg_replace("[^-\_0-9a-zA-Z]","",$agi_output); ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); @@ -856,6 +868,21 @@ echo "
NUMBER CHANNEL GROUP DATE LENGTH(MIN.)
\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Contexto del defecto - el contexto dialplan del defecto usado para las escrituras que funcionan para este servidor. El defecto es 'defecto' +
+ +
+System Performance - Setting this option to Y will enable logging of system performance stats for the server machine including system load, system processes and Asterisk channels in use. Default is N. + +
+
+
+Server Logs - Setting this option to Y will enable logging of all VICIDIAL related scripts to their text log files. Setting this to N will stop writing logs to files for these processes, also the screen logging of asterisk will be disabled if this is set to N when Asterisk is started. Default is Y. + +
+
+
+AGI Output - Setting this option to NONE will disable output from all VICIDIAL related AGI scripts. Setting this to STDERR will send the AGI output to the Asterisk CLI. Setting this to FILE will send the output to a file in the logs directory. Setting this to BOTH will send output to both the Asterisk CLI and a log file. Default is FILE. +



@@ -944,7 +971,7 @@ echo "
Nombre Completo: < echo "
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
\n"; @@ -1196,7 +1223,7 @@ echo "
Foto: Mensajes Nuevos: $row[14]$NWB#phones-messages$NWE
Mensajes Viejos: $row[15]$NWB#phones-old_messages$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
Login del Manager: $NWB#phones-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#phones-ASTmgrSECRET$NWE
Usuario por defecto de VICIDIAL: $NWB#phones-login_user$NWE
Contraseña del Manager: Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; @@ -1421,7 +1451,7 @@ echo "
Foto: Mensajes Nuevos: $row[14]$NWB#phones-messages$NWE
Mensajes Viejos: $row[15]$NWB#phones-old_messages$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
Login del Manager: $NWB#phones-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#phones-ASTmgrSECRET$NWE
Usuario por defecto de VICIDIAL: $NWB#phones-login_user$NWE
Contraseña del Manager: Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
System Performance: $NWB#servers-sys_perf_log$NWE
Server Logs: $NWB#servers-vd_server_logs$NWE
AGI Output: $NWB#servers-agi_output$NWE
\n"; diff --git a/agc_2-X/trunk/LANG_www/astguiclient_es/dbconnect.php b/agc_2-X/trunk/LANG_www/astguiclient_es/dbconnect.php index 1662f18f..d562e3dd 100644 --- a/agc_2-X/trunk/LANG_www/astguiclient_es/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/astguiclient_es/dbconnect.php @@ -1,15 +1,48 @@ - + LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); + +$local_DEF = 'Local/'; +$conf_silent_prefix = '7'; +$local_AMP = '@'; +$ext_context = 'demo'; +$recording_exten = '8309'; +$WeBRooTWritablE = '1'; + +?> diff --git a/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDAD_closer.php b/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDAD_closer.php index eb7d3c39..f8ba16b0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDAD_closer.php +++ b/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDAD_closer.php @@ -173,7 +173,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $ext_count) { - $stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; + $stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $camp_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall.php index 540a5eb6..4cf25f00 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall.php @@ -13,6 +13,7 @@ # 60608-1539 - Fixed CLOSER tallies for active calls # 60619-1658 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 60626-1453 - Added display of system load to bottom (Angelito Manansala) # header ("Content-type: text/html; charset=utf-8"); @@ -39,6 +40,46 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (!isset($group)) {$group='';} +function get_server_load($windows = false) { +$os = strtolower(PHP_OS); +if(strpos($os, "win") === false) { +if(file_exists("/proc/loadavg")) { +$load = file_get_contents("/proc/loadavg"); +$load = explode(' ', $load); +return $load[0]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $load[count($load)-1]; +} +else { +return false; +} +} +elseif($windows) { +if(class_exists("COM")) { +$wmi = new COM("WinMgmts:\\\\."); +$cpus = $wmi->InstancesOf("Win32_Processor"); + +$cpuload = 0; +$i = 0; +while ($cpu = $cpus->Next()) { +$cpuload += $cpu->LoadPercentage; +$i++; +} + +$cpuload = round($cpuload / $i, 2); +return "$cpuload%"; +} +else { +return false; +} +} +} + +$load_ave = get_server_load(true); + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -139,10 +180,11 @@ echo "\n\n"; if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} else { -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $HOPlev = $row[8]; +$DIALmethod = $row[9]; echo "
"; echo ""; @@ -156,13 +198,21 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct,differential_onemin,agents_average_onemin from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $DAleads = $row[0]; $callsTODAY = $row[1]; $dropsTODAY = $row[2]; $drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; +$agentsONEMIN = $row[5]; +if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } +else {$diffpctONEMIN = '0.00';} echo ""; echo ""; @@ -175,6 +225,13 @@ echo ""; echo ""; echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + echo "
DIAL LEVEL:  $row[0]   
HOPPER LEVEL:  $HOPlev     CALLS TODAY:CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
DIAL METHOD:  $DIALmethod     DL DIFF:  $diffONEMIN     AVG AGENTS:  $agentsONEMIN     DIFF:  $diffpctONEMIN%    
"; @@ -295,7 +352,7 @@ $talking_to_print = mysql_num_rows($rslt); # if ($call_time_M_int >= 10) {$G=''; $EG='';} if (eregi("PAUSED",$row[3])) { - if ($call_time_M_int >= 1) + if ($call_time_M_int >= 5) {$i++; continue;} else {$G=''; $EG=''; $agent_paused++; $agent_total++;} @@ -314,7 +371,8 @@ $talking_to_print = mysql_num_rows($rslt); } $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " System Load Average: $load_ave\n\n"; $Aecho .= " - Paused agents\n"; # $Aecho .= " - Balanced call\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall_SIPmonitor.php b/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall_SIPmonitor.php index 0b24f82e..355a6fcd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall_SIPmonitor.php +++ b/agc_2-X/trunk/LANG_www/vicidial/AST_timeonVDADall_SIPmonitor.php @@ -1,301 +1,323 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - - - - - - + LICENSE: GPLv2 +### Contributions by Magma Networks LLC +### +# live real-time stats for the VICIDIAL Auto-Dialer all servers +# +# changes: +# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) +# 51130-1218 - Modified layout and info to show all servers in a vicidial system +# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala +# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# - Added 10 minutes on call (Magma Networks LLC) +# - Added extended pause (exceeding 60 seconds -> 20 minutes) (Magma Networks LLC) +# - Added Full Name Field to extract from Database (Magma Networks LLC) +# - Added Barge Link (Magma Networks LLC) +# 60731-1138 - fixed fullname formatting + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} +$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} +$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} +$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} +$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} +$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} +$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$stmt="select campaign_id from vicidial_campaigns;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } + +if (!$RR) {$RR=40;} + +$NFB = ''; +$NFE = ''; +$F=''; $FG=''; $B=''; $BG=''; +$reset_counter++; + +if ($reset_counter > 7) + { + $reset_counter=0; + } + +?> + + + + + +\n"; +echo"\n"; +echo "VICIDIAL: Time On VDAD Campaign: $group\n"; +echo "
\n"; +echo "VICIDIAL: Realtime Campaign: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "         \n"; +echo "STOP | GO"; +echo "         MODIFY | REPORTS \n"; +echo "\n\n"; + +if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); + +echo "
"; +echo "DIAL LEVEL: $row[0]         "; +echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; +echo "ORDER: $row[6]"; +echo "\n\n"; +} +################################################################################### +###### OUTBOUND CALLS +################################################################################### +if (eregi("CLOSER",$group)) + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} +else + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + {$out_live++;} + else + { + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + $out_total++; + $i++; + } + + if ($out_live > 0) {$F=''; $FG='';} + if ($out_live > 4) {$F=''; $FG='';} + if ($out_live > 9) {$F=''; $FG='';} + if ($out_live > 14) {$F=''; $FG='';} + + if (eregi("CLOSER",$group)) + {echo "$NFB$out_total$NFE current active calls      \n";} + else + {echo "$NFB$out_total$NFE calls being placed       \n";} + + echo "$NFB$out_ring$NFE calls ringing         \n"; + echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + } + else + { + echo " NO LIVE CALLS WAITING \n"; + } + + +################################################################################### +###### TIME ON SYSTEM +################################################################################### + +$agent_incall=0; +$agent_ready=0; +$agent_paused=0; +$agent_total=0; + +$Aecho = ''; +$Aecho .= "VF DIALER: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; +$Aecho .= "| STATION | USER | FULL NAME | SESSIONID | BARGE | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; + + +$stmt=" + select + extension, + vicidial_live_agents.user, + conf_exten, + status, + server_ip, + UNIX_TIMESTAMP(last_call_time), + UNIX_TIMESTAMP(last_call_finish), + call_server_ip, + campaign_id, + vicidial_users.full_name as full_name + from vicidial_live_agents + left join vicidial_users on vicidial_live_agents.user = vicidial_users.user + where + campaign_id='" . mysql_real_escape_string($group) . "' + order by + status, + last_call_time; +"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + $agentcount=0; + while ($i < $talking_to_print) + { + $row=mysql_fetch_row($rslt); + if (eregi("READY|PAUSED",$row[4])) + { + $row[5]=$row[6]; + } + $extension = sprintf("%-10s", $row[0]); + $user = sprintf("%-6s", $row[1]); + $sessionid = sprintf("%-9s", $row[2]); + $status = sprintf("%-6s", $row[3]); + $server_ip = sprintf("%-15s", $row[4]); + $call_server_ip = sprintf("%-15s", $row[7]); + $campaign_id = sprintf("%-10s", $row[8]); + $full_name = sprintf("%-15s", $row[9]); + while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);} + $call_time_S = ($STARTtime - $row[5]); + + $call_time_M = ($call_time_S / 60); + $call_time_M = round($call_time_M, 2); + $call_time_M_int = intval("$call_time_M"); + $call_time_SEC = ($call_time_M - $call_time_M_int); + $call_time_SEC = ($call_time_SEC * 60); + $call_time_SEC = round($call_time_SEC, 0); + if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} + $call_time_MS = "$call_time_M_int:$call_time_SEC"; + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + if ($call_time_M_int >= 5) {$G=''; $EG='';} +# if ($call_time_M_int >= 10) {$G=''; $EG='';} + if (eregi("PAUSED",$row[3])) + { + if ($call_time_M_int >= 20) + {$i++; continue;} + else + {$G=''; $EG=''; $agent_paused++; $agent_total++;} + } +# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) +# {$G=''; $EG='';} + + if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} + $sessionid = trim($sessionid); + + $agentcount++; + $Aecho .= "| $G$extension$EG | $G$user$EG | $G$full_name$EG | $G$sessionid$EG LISTEN | BARGE | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; + + $i++; + } + + $Aecho .= "+------------|--------+-----------------+----------------+--------+--------+-----------------+-----------------+---------+------------+\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " NOTE: Click LISTEN to monitor agent call, you must have installed softphone on you machine.\n\n"; + + + $Aecho .= " - Paused agents\n"; + # $Aecho .= " - Balanced call\n"; + $Aecho .= " - Agent waiting for call\n"; + $Aecho .= " - Over 5 minutes on call\n"; + $Aecho .= " - Over 10 minutes on call\n"; + if ($agent_ready > 0) {$B=''; $BG='';} + if ($agent_ready > 4) {$B=''; $BG='';} + if ($agent_ready > 9) {$B=''; $BG='';} + if ($agent_ready > 14) {$B=''; $BG='';} + + + echo "\n
\n"; + + echo "$NFB$agent_total$NFE agents logged in         \n"; + + echo "$NFB$agent_incall$NFE agents in calls       \n"; + echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; + echo "$NFB$agent_paused$NFE paused agents       \n"; + + echo "
";
+		echo "";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo " NO AGENTS ON CALLS \n";
+	}
+
+?>
+
+ + diff --git a/agc_2-X/trunk/LANG_www/vicidial/admin.php b/agc_2-X/trunk/LANG_www/vicidial/admin.php index e296c40c..9f9c02b6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial/admin.php @@ -274,6 +274,25 @@ if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} +if (isset($_GET["allcalls_delay"])) {$allcalls_delay=$_GET["allcalls_delay"];} + elseif (isset($_POST["allcalls_delay"])) {$allcalls_delay=$_POST["allcalls_delay"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} +if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} + elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} +if (isset($_GET["adaptive_dropped_percentage"])) {$adaptive_dropped_percentage=$_GET["adaptive_dropped_percentage"];} + elseif (isset($_POST["adaptive_dropped_percentage"])){$adaptive_dropped_percentage=$_POST["adaptive_dropped_percentage"];} +if (isset($_GET["available_only_ratio_tally"])) {$available_only_ratio_tally=$_GET["available_only_ratio_tally"];} + elseif (isset($_POST["available_only_ratio_tally"])){$available_only_ratio_tally=$_POST["available_only_ratio_tally"];} +if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} + elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} +if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$_GET["adaptive_latest_server_time"];} + elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} +if (isset($_GET["adaptive_intensity"])) {$adaptive_intensity=$_GET["adaptive_intensity"];} + elseif (isset($_POST["adaptive_intensity"])) {$adaptive_intensity=$_POST["adaptive_intensity"];} +if (isset($_GET["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_GET["adaptive_dl_diff_target"];} + elseif (isset($_POST["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_POST["adaptive_dl_diff_target"];} + if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -283,8 +302,6 @@ if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum ### DIGITS ONLY ### $user_level = ereg_replace("[^0-9]","",$user_level); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); @@ -344,6 +361,9 @@ $attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); $attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); $hotkey = ereg_replace("[^0-9]","",$hotkey); $list_id = ereg_replace("[^0-9]","",$list_id); +$allcalls_delay = ereg_replace("[^0-9]","",$allcalls_delay); +$adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage); +$adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -357,6 +377,8 @@ $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); $drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code); +$available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally); ### ALPHA-NUMERIC ONLY ### $user = ereg_replace("[^0-9a-zA-Z]","",$user); @@ -377,10 +399,15 @@ $scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); +$adaptive_maximum_level = ereg_replace("[^\.0-9]","",$adaptive_maximum_level); -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); +### ALPHA-NUMERIC and spaces and hash and star and comma +$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); +$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf); + +### ALPHACAPS-NUMERIC +$xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); +$xferconf_b_number = ereg_replace("[^0-9A-Z]","",$xferconf_b_number); ### ALPHA-NUMERIC and underscore and dash $dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); @@ -402,6 +429,7 @@ $group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); $user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); $OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); $state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); +$dial_method = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_method); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -424,6 +452,8 @@ $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comm $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); +$adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); +$adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); @@ -493,13 +523,23 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 60613-1415 - Added lead recycling options to campaign detail screen # 60619-1523 - Added variable filtering to eliminate SQL injection attack threat # 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug +# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug +# 60808-1147 - changed filtering for and added instructions for consutative transfers +# 60816-1552 - added allcalls_delay start delay for recordings in vicidial.php +# 60817-2226 - fixed bug that would not allow lead recycling of non-selectable statuses +# 60821-1543 - added option to Omit Phone Code while dialing in vicidial +# 60821-1625 - added ALLFORCE recording option for campaign_recording +# 60823-1154 - added fields for adaptive dialing +# 60824-1326 - added adaptive_latest_target_gmt for ADAPT_TAPERED dial method +# 60825-1205 - added adaptive_intensity for ADAPT_ dial methods +# 60828-1019 - changed adaptive_latest_target_gmt to adaptive_latest_server_time +# 60828-1115 - added adaptive_dl_diff_target and changed intensity dropdown # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$version = '1.1.12-3'; -$build = '60623-1159'; +$version = '2.0.65'; +$build = '60828-1115'; $STARTtime = date("U"); @@ -1076,11 +1116,46 @@ echo "
Force Reset of Hopper - This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. +
+ +
+Dial Method - This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift(as defined by call_time selected for campaign) and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. +

Auto Dial Level - This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow. +
+
+
+Available Only Tally - This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N. + +
+
+
+Drop Percentage Limit - This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO. + +
+
+
+Maximum Adapt Dial Level - This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Auto Dial Level if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0. + +
+
+
+Latest Server Time - This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling. + +
+
+
+Adapt Intensity Modifier - This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods. + +
+
+
+Dial Level Difference Target - This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or RATIO dial methods. +

@@ -1105,6 +1180,11 @@ echo "
Dial Prefix - This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dialplan - extensions.conf. +
+ +
+Omit Phone Code - This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dialplan extensions.conf to place calls instead of 44 then 10 digits. Default is N. +

@@ -1123,13 +1203,18 @@ echo "

-Campaign Recording - This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. +Campaign Recording - This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load.

Campaign Rec Filename - This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. +
+
+
+Recording Delay - For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0. +

@@ -1153,7 +1238,7 @@ echo "

-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. +Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1300,7 +1385,7 @@ echo "

-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. +Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1965,7 +2050,7 @@ if (strlen($phone_number) > 2) echo "
ADD A NUMBER TO THE DNC LIST
\n"; echo "\n"; echo "
\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
\n"; @@ -2813,7 +2898,29 @@ if ($ADD==41) { echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -2928,7 +3035,29 @@ if ($ADD==44) { echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -4215,6 +4344,15 @@ echo "\n"; @@ -4290,7 +4432,58 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + + + +echo "\n"; + echo "\n"; @@ -4303,16 +4496,20 @@ echo "\n"; +echo "\n"; + echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; +echo "\n"; + echo "
\n"; $wrapup_message = $row[41]; # $closer_campaigns = $row[42]; $use_internal_dnc = $row[43]; + $allcalls_delay = $row[44]; + $omit_phone_code = $row[45]; + $dial_method = $row[46]; + $available_only_ratio_tally = $row[47]; + $adaptive_dropped_percentage = $row[48]; + $adaptive_maximum_level = $row[49]; + $adaptive_latest_server_time = $row[50]; + $adaptive_intensity = $row[51]; + $adaptive_dl_diff_target = $row[52]; echo "
MODIFY A CAMPAIGNS RECORD: $row[0] - Basic View"; echo " | Detail View | "; @@ -4237,28 +4375,32 @@ echo "
Dial status 1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' and selectable='Y' order by status"; + $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Hopper Level: Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Available Only Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Drop Percentage Limit: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Maximum Adapt Dial Level: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Latest Server Time: 4 digits only $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Dial Level Difference Target: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Dial Timeout: Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omit Phone Code: $NWB#vicidial_campaigns-omit_phone_code$NWE
Campaign CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Campaign VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Campaign Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Rec Filename: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Recording Delay: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: \n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "Attempt Delay: \n"; echo "Attempt Maximum: \n"; @@ -4612,6 +4809,8 @@ echo "\n"; @@ -4683,7 +4884,24 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial/dbconnect.php index 1662f18f..7221b35e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial/dbconnect.php @@ -1,15 +1,48 @@ LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; - -$WeBServeRRooT = '/usr/local/apache2/htdocs'; $WeBRooTWritablE = '1'; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial/listloader.php b/agc_2-X/trunk/LANG_www/vicidial/listloader.php index 920505a8..6f5ec297 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/listloader.php +++ b/agc_2-X/trunk/LANG_www/vicidial/listloader.php @@ -11,12 +11,13 @@ # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60616-1006 - added listID override and gmt_offset lookup while loading # 60619-1652 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1105 - fixed for nonwritable directories # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # -$version = '1.1.12'; -$build = '60619-1652'; +$version = '2.0.1'; +$build = '60822-1105'; header ("Content-type: text/html; charset=utf-8"); @@ -142,8 +143,16 @@ function ShowProgress(good, bad, total) { if ($leadfile and filesize($LF_path)<=8388608) { print ""; flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "./vicidial_temp_file.txt"; + } + else + { + $lead_file = "$LF_path"; + } + $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} $pulldate=date("Y-m-d H:i:s"); @@ -157,7 +166,7 @@ if ($leadfile and filesize($LF_path)<=8388608) { if (count($field_check)>=5) { flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; @@ -199,7 +208,7 @@ if ($leadfile and filesize($LF_path)<=8388608) { $security_phrase = $row[21]; $comments = trim($row[22]); - if (strlen($phone_number)>8) + if (strlen($phone_number)>6) { $entry_date = "$pulldate"; $modify_date = ""; diff --git a/agc_2-X/trunk/LANG_www/vicidial/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial/listloader.pl index 753c31f7..6c5a6dd0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/listloader.pl +++ b/agc_2-X/trunk/LANG_www/vicidial/listloader.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -### listloader.pl +### listloader.pl version 0.3 *DBI-version* ### ### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 ### @@ -9,6 +9,9 @@ # CHANGES # 60616-1548 - Added listID override feature to force all leads into same list # - Added gmt_offset_now lookup for each lead +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# 60822-1121 - fixed for nonwritable directories # ### begin parsing run-time options ### @@ -31,10 +34,20 @@ if (length($ARGV[0])>1) { @data_in = split(/--forcelistid=/,$args); $forcelistid = $data_in[1]; + $forcelistid =~ s/ .*//gi; print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; } else {$forcelistid = '';} + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} } } ### end parsing run-time options ### @@ -42,15 +55,54 @@ if (length($ARGV[0])>1) use Spreadsheet::ParseExcel; use Time::Local; -use Net::MySQL; +use DBI; -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file -if (!$DB_port) {$DB_port='3306';} +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; +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 =~ /^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_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; $|=0; @@ -72,16 +124,18 @@ $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); ### Grab Server values from the database $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $DBSERVER_GMT = "$record->[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - } + @aryA = $sthA->fetchrow_array; + $DBSERVER_GMT = "$aryA[0]"; + if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + $rec_count++; } + $sthA->finish(); $LOCAL_GMT_OFF = $SERVER_GMT; $LOCAL_GMT_OFF_STD = $SERVER_GMT; @@ -93,9 +147,9 @@ if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOC $total=0; $good=0; $bad=0; print "
Processing Excel file...\n"; -open(STMT_FILE, "> listloader_stmts.txt"); +open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); my($iR, $iC, $oWkS, $oWkC); foreach $oWkS (@{$oBook->{Worksheet}}) { @@ -159,7 +213,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($oWkC) {$comments=$oWkC->Value; } $comments=~s/^\s*(.*?)\s*$/$1/; - if (length($phone_number)>8) { + if (length($phone_number)>6) { if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -171,76 +225,80 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### MEXICO ### if ($phone_code =~ /^52$/) { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### AUSTRALIA ### if ($phone_code =~ /^61$/) { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### ALL OTHER COUNTRY CODES ### if (!$PC_processed) { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### Find out if DST to raise the gmt offset ### @@ -307,7 +365,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $dbhA->query("$stmtZ"); + $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; @@ -333,7 +391,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 0) { $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $dbhA->query("$stmtZ"); + $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial/listloaderMAIN.php index 67ee25bc..bb292c36 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial/listloaderMAIN.php @@ -8,6 +8,7 @@ # # changes: # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1105 - fixed for nonwritable directories # require("dbconnect.php"); @@ -30,7 +31,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -59,13 +60,19 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial/listloader_rowdisplay.pl b/agc_2-X/trunk/LANG_www/vicidial/listloader_rowdisplay.pl index ca0da8c5..fad44122 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/listloader_rowdisplay.pl +++ b/agc_2-X/trunk/LANG_www/vicidial/listloader_rowdisplay.pl @@ -1,18 +1,98 @@ #!/usr/bin/perl + +### listloader_rowdisplay.pl version 0.2 *DBI-version* +### +### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 +### +# +# CHANGES +# +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) +{ + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help|-h/i) + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + } + else + { + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} + } +} +### end parsing run-time options ### + use Spreadsheet::ParseExcel; use Time::Local; -use Net::MySQL; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; +use DBI; -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +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 =~ /^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_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); my($iR, $iC, $oWkS, $oWkC); $var_str=""; @@ -30,27 +110,38 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { @xls_row=split(/\|/, $var_str); -$dbhA->query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1"); +$stmtA = "select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + my $names = $sthA->{'NAME'}; + my $numFields = $sthA->{'NUM_OF_FIELDS'}; + for (my $i = 0; $i < $numFields; $i++) + { + # printf("%s%s", $i ? "," : "", $$names[$i]); + # printf("%s%s", $i ? "," : "", $$ref[$i]); -if ($dbhA->has_selected_record) { - $rslt = $dbhA->create_record_iterator(); - my @row = $rslt->get_field_names(); - for ($i=0; $i\r\n"; print "
\r\n"; + } + $rec_count++; } -} +$sthA->finish(); +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial/listloader_super.pl index a36765d0..8e41bb39 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/listloader_super.pl +++ b/agc_2-X/trunk/LANG_www/vicidial/listloader_super.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -### listloader_super.pl +### listloader_super.pl version 0.2 *DBI-version* ### ### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 ### @@ -9,6 +9,8 @@ # CHANGES # 60616-1548 - Added listID override feature to force all leads into same list # - Added gmt_offset_now lookup for each lead +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs # ### begin parsing run-time options ### @@ -31,25 +33,74 @@ if (length($ARGV[0])>1) { @data_in = split(/--forcelistid=/,$args); $forcelistid = $data_in[1]; + $forcelistid =~ s/ .*//gi; print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; } else {$forcelistid = '';} + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} } } ### end parsing run-time options ### use Spreadsheet::ParseExcel; use Time::Local; -use Net::MySQL; +use DBI; -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file -if (!$DB_port) {$DB_port='3306';} +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; +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 =~ /^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_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; $vars=$ARGV[0]; @@ -74,16 +125,18 @@ $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); ### Grab Server values from the database $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $DBSERVER_GMT = "$record->[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - } + @aryA = $sthA->fetchrow_array; + $DBSERVER_GMT = "$aryA[0]"; + if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + $rec_count++; } + $sthA->finish(); $LOCAL_GMT_OFF = $SERVER_GMT; $LOCAL_GMT_OFF_STD = $SERVER_GMT; @@ -94,9 +147,9 @@ if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOC $total=0; $good=0; $bad=0; -open(STMT_FILE, "> listloader_stmts.txt"); +open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); my($iR, $iC, $oWkS, $oWkC); foreach $oWkS (@{$oBook->{Worksheet}}) { @@ -160,7 +213,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($oWkC) {$comments=$oWkC->Value; } $comments=~s/^\s*(.*?)\s*$/$1/; - if (length($phone_number)>8) { + if (length($phone_number)>6) { if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -172,76 +225,80 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### MEXICO ### if ($phone_code =~ /^52$/) { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### AUSTRALIA ### if ($phone_code =~ /^61$/) { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### ALL OTHER COUNTRY CODES ### if (!$PC_processed) { $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; } + $sthA->finish(); } ### Find out if DST to raise the gmt offset ### @@ -308,7 +365,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $dbhA->query("$stmtZ"); + $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; @@ -334,7 +391,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 0) { $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $dbhA->query("$stmtZ"); + $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial/new_listloader_superL.php index 6c0ac713..b5d149a2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial/new_listloader_superL.php @@ -13,11 +13,12 @@ # 60616-1240 - added listID override # 60616-1604 - added gmt lookup for each lead # 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '1.1.12-1'; -$build = '60619-1651'; +$version = '2.0.1'; +$build = '60822-1121'; require("dbconnect.php"); @@ -94,6 +95,8 @@ if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"]; if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} @@ -114,7 +117,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -143,13 +146,19 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } } } @@ -303,9 +312,11 @@ function ParseFileName() { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); $pipe_count=substr_count($buffer, "|"); @@ -315,7 +326,7 @@ function ParseFileName() { if (count($field_check)>=5) { flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); print "
Processing $delim_name-delimited file...\n"; if (strlen($list_id_override)>0) @@ -364,7 +375,7 @@ function ParseFileName() { $security_phrase = $row[$security_phrase_field]; $comments = trim($row[$comments_field]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) @@ -416,19 +427,21 @@ function ParseFileName() { } } else if (!eregi(".csv", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); + $file=fopen("$lead_file", "r"); print "
Processing Excel file... \n"; if (strlen($list_id_override)>0) { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); + # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead-file=$lead_file"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + $file=fopen("$lead_file", "r"); + + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} print "
Processing CSV file... \n"; if (strlen($list_id_override)>0) @@ -471,7 +484,7 @@ function ParseFileName() { $security_phrase = $row[$security_phrase_field]; $comments = trim($row[$comments_field]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) { @@ -528,9 +541,18 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "./vicidial_temp_file.txt"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); @@ -542,7 +564,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (count($field_check)>=5) { flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; if (strlen($list_id_override)>0) @@ -590,7 +612,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $security_phrase = $row[21]; $comments = trim($row[22]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) { @@ -640,15 +662,39 @@ if ($leadfile && filesize($LF_path)<=8388608) { } else { print "
ERROR: The file does not have the required number of fields to process it.
"; } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); + } else if (!eregi(".csv", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.xls"); + $lead_file = "/tmp/vicidial_temp_file.xls"; + } + $file=fopen("$lead_file", "r"); - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file"); + + } + else + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.csv"); + $lead_file = "/tmp/vicidial_temp_file.csv"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} print "
Processing CSV file... \n"; @@ -691,7 +737,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $security_phrase = $row[21]; $comments = trim($row[22]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) { @@ -752,10 +798,21 @@ if ($leadfile && filesize($LF_path)<=8388608) { $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -764,7 +821,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); print "
Processing $delim_name-delimited file...\n"; if (strlen($list_id_override)>0) @@ -826,13 +883,39 @@ if ($leadfile && filesize($LF_path)<=8388608) { #print " \r\n"; #print " \r\n"; } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + } + else if (!eregi(".csv", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.xls"); + $lead_file = "/tmp/vicidial_temp_file.xls"; + } + + # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file"); + } + else + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.csv"); + $lead_file = "/tmp/vicidial_temp_file.csv"; + } + $file=fopen("$lead_file", "r"); + + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} print "
Processing CSV file... \n"; @@ -895,6 +978,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { } } print "
\r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print " \r\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial/vtiger_search.php new file mode 100644 index 00000000..6eaaf1bf --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial/vtiger_search.php @@ -0,0 +1,313 @@ + LICENSE: GPLv2 +### +# This page does a search against a standard vtiger CRM system. If the record +# is not present, it will create a new one and send the agent's screen to that new page. +# +# This code is tested against vtiger 4.2 +# +# CHANGES +# 60719-1615 - First version +# 60801-2304 - added mysql debug and auto-forward +# 60802-1111 - added insertion of not-found record into vtiger system +# + +#Asterisk/VICIDIAL Server (ASTERISK) +#Internal : 10.10.10.15 +#External : 55.55.55.55 + +#vtiger Server(TEST1) +#Internal : 10.10.10.16 +#External : 55.55.55.56 + + +### alter to connect to your vtiger database +$link=mysql_connect("10.10.10.16", "cron",'1234'); +if (!$link) {die('Could not connect: ' . mysql_error());} +echo 'Connected successfully'; +mysql_select_db("vtigercrm4_2"); + + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["address1"])) {$address1=$_GET["address1"];} + elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} +if (isset($_GET["address2"])) {$address2=$_GET["address2"];} + elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} +if (isset($_GET["address3"])) {$address3=$_GET["address3"];} + elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} +if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} +if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} + elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["channel"])) {$channel=$_GET["channel"];} + elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} +if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} + elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} +if (isset($_GET["city"])) {$city=$_GET["city"];} + elseif (isset($_POST["city"])) {$city=$_POST["city"];} +if (isset($_GET["comments"])) {$comments=$_GET["comments"];} + elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} +if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} +if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} + elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} + elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["email"];} +if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} + elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} + elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} +if (isset($_GET["province"])) {$province=$_GET["province"];} + elseif (isset($_POST["province"])) {$province=$_POST["province"];} +if (isset($_GET["security"])) {$security=$_GET["security"];} + elseif (isset($_POST["security"])) {$security=$_POST["security"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["state"])) {$state=$_GET["state"];} + elseif (isset($_POST["state"])) {$state=$_POST["state"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} + elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +#$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +#$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +#$DB = '1'; # DEBUG override +$US = '_'; +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$REC_TIME = date("Ymd-His"); +$FILE_datetime = $STARTtime; +$parked_time = $STARTtime; + +# $ext_context = 'default'; defined in dbconnect file + +# $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# $row=mysql_fetch_row($rslt); +# $auth=$row[0]; + +#$fp = fopen ("./project_auth_entries.txt", "a"); +#$date = date("r"); +#$ip = getenv("REMOTE_ADDR"); +#$browser = getenv("HTTP_USER_AGENT"); + +# if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) +# { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); +# Header("HTTP/1.0 401 Unauthorized"); +# echo "Invalid Username/Password: |$user|$pass|\n"; +# exit; +# } +# else +# { +# +# if($auth>0) +# { +# $office_no=strtoupper($user); +# $password=strtoupper($pass); +# $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# $row=mysql_fetch_row($rslt); +# $LOGfullname=$row[0]; +# $fullname = $row[0]; +# fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); +# fclose($fp); +# +# if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) ) +# { +# echo "\n\n"; +# echo "\n\n"; +# +# } +# else +# { +# echo "Bad channel: $customer_zap_channel\n"; +# echo "Make sure the Zap channel is live and try again\n"; +# exit; +# } +# +# } +# else +# { +# fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); +# fclose($fp); +# } +# } + +echo "\n"; +echo "\n"; +echo "VICIDIAL Vtiger Lookup\n"; +echo "\n"; + + +$stmt="SELECT count(*) from account where phone='$phone' or otherphone='$phone' or fax='$phone';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +if (!$rslt) { + die('Could not execute: ' . mysql_error()); +} +$row=mysql_fetch_row($rslt); +$found_count = $row[0]; + +#echo "
\n|$phone|$found_count|\n"; + +if ($found_count < 1) +{ + echo "\n"; + echo "\n"; + echo "
\n"; + echo "$phone not found, creating account...\n"; + + if ($DB) {echo "
";}
+	$stmt="SELECT id from users where user_name='$user';";
+	if ($DB) {echo "$stmt\n";}
+	$rslt=mysql_query($stmt, $link);
+	$row=mysql_fetch_row($rslt);
+	$user_id = $row[0];
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO crmentity (smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$user_id', '$user_id', 0, 'Accounts', NULL, '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, 0, 1, 1);";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	$recordID = mysql_insert_id($link);
+	if ($DB) {echo "|$recordID|\n";}
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+#	$stmt = "INSERT INTO accountscf (accountid, cf_393, cf_397, cf_403, cf_405, cf_407, cf_409, cf_411) VALUES ('$recordID', NULL, NULL, NULL, NULL, NULL, NULL, NULL);";
+#	if ($DB) {echo "|$stmt|\n";}
+#	$rslt=mysql_query($stmt, $link);
+#	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO account (accountid,accountname,contactname,phone,otherphone,email1) values('$recordID','$last_name, $first_name','$first_name $last_name','$phone','$alt_phone','$email');";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO accountbillads (accountaddressid,city,code,country,state,street) values('$recordID','$city','$postal_code','US','$state','$address1');";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO accountshipads (accountaddressid,city,code,country,state,street) values('$recordID','$city','$postal_code','US','$state','$address1');";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	if ($DB) {echo "DONE\n";}
+
+	$account_URL = "http://55.55.55.56/index.php?module=Accounts&action=DetailView&record=$recordID";
+	echo "\n";
+	echo "\n";
+	echo "\n";
+	echo "
\n"; + + echo "
";
+	echo "account created!\n";
+	echo "accountid:   $recordID\n";
+	echo "phone:       $phone\n";
+	echo "

"; + +} +else +{ + $stmt="SELECT accountid,accountname,contactname from account where phone='$phone' or otherphone='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $accountid = $row[0]; + $accountname = $row[1]; + $contactname = $row[2]; + + $account_URL = "http://55.55.55.56/index.php?module=Accounts&action=DetailView&record=$accountid"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "
";
+	echo "account found!\n";
+	echo "accountid:   $accountid\n";
+	echo "phone:       $phone\n";
+	echo "accountname: $accountname\n";
+	echo "contactname: $contactname\n";
+	echo "

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


\n\n"; + + +echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; + + +?> + + + + + + + + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDAD_closer.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDAD_closer.php index b7e87d02..62aceab4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDAD_closer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDAD_closer.php @@ -173,7 +173,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $ext_count) { - $stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; + $stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $camp_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php index 4ad6fb65..a98a3482 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall.php @@ -13,6 +13,7 @@ # 60608-1539 - Fixed CLOSER tallies for active calls # 60619-1658 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 60626-1453 - Added display of system load to bottom (Angelito Manansala) # header ("Content-type: text/html; charset=utf-8"); @@ -39,6 +40,46 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (!isset($group)) {$group='';} +function get_server_load($windows = false) { +$os = strtolower(PHP_OS); +if(strpos($os, "win") === false) { +if(file_exists("/proc/loadavg")) { +$load = file_get_contents("/proc/loadavg"); +$load = explode(' ', $load); +return $load[0]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $load[count($load)-1]; +} +else { +return false; +} +} +elseif($windows) { +if(class_exists("COM")) { +$wmi = new COM("WinMgmts:\\\\."); +$cpus = $wmi->InstancesOf("Win32_Processor"); + +$cpuload = 0; +$i = 0; +while ($cpu = $cpus->Next()) { +$cpuload += $cpu->LoadPercentage; +$i++; +} + +$cpuload = round($cpuload / $i, 2); +return "$cpuload%"; +} +else { +return false; +} +} +} + +$load_ave = get_server_load(true); + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -139,10 +180,11 @@ echo "\n\n"; if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} else { -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $HOPlev = $row[8]; +$DIALmethod = $row[9]; echo "
\n"; $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $display_dialable_count = $row[39]; + $dial_method = $row[46]; + $adaptive_intensity = $row[51]; echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Basic View | "; echo "Detail View | "; @@ -4634,24 +4833,26 @@ echo "
Dial status 1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Hopper Level: Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
".$field_name.": \r\n"; - print " \r\n"; print "
        
"; echo ""; @@ -156,13 +198,21 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct,differential_onemin,agents_average_onemin from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $DAleads = $row[0]; $callsTODAY = $row[1]; $dropsTODAY = $row[2]; $drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; +$agentsONEMIN = $row[5]; +if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } +else {$diffpctONEMIN = '0.00';} echo ""; echo ""; @@ -175,6 +225,13 @@ echo ""; echo ""; echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + echo "
DIAL LEVEL:  $row[0]   
HOPPER LEVEL:  $HOPlev     CALLS TODAY:CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
DIAL METHOD:  $DIALmethod     DL DIFF:  $diffONEMIN     AVG AGENTS:  $agentsONEMIN     DIFF:  $diffpctONEMIN%    
"; @@ -295,7 +352,7 @@ $talking_to_print = mysql_num_rows($rslt); # if ($call_time_M_int >= 10) {$G=''; $EG='';} if (eregi("PAUSED",$row[3])) { - if ($call_time_M_int >= 1) + if ($call_time_M_int >= 5) {$i++; continue;} else {$G=''; $EG=''; $agent_paused++; $agent_total++;} @@ -314,7 +371,8 @@ $talking_to_print = mysql_num_rows($rslt); } $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " System Load Average: $load_ave\n\n"; $Aecho .= " - Pausierte Mittel\n"; # $Aecho .= " - Balanced call\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall_SIPmonitor.php b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall_SIPmonitor.php index dff474ef..d5d80df2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall_SIPmonitor.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/AST_timeonVDADall_SIPmonitor.php @@ -1,301 +1,326 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Kampagne: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Kampagne: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         ÄNDERN Sie | REPORTS \n"; -echo "\n\n"; - -if (!$group) {echo "

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

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); + +echo "
"; +echo "DIAL LEVEL: $row[0]         "; +echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; +echo "ORDER: $row[6]"; +echo "\n\n"; +} +################################################################################### +###### OUTBOUND CALLS +################################################################################### +if (eregi("CLOSER",$group)) + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} +else + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + {$out_live++;} + else + { + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + $out_total++; + $i++; + } + + if ($out_live > 0) {$F=''; $FG='';} + if ($out_live > 4) {$F=''; $FG='';} + if ($out_live > 9) {$F=''; $FG='';} + if ($out_live > 14) {$F=''; $FG='';} + + if (eregi("CLOSER",$group)) + {echo "$NFB$out_total$NFE current active calls      \n";} + else + {echo "$NFB$out_total$NFE calls being placed       \n";} + + echo "$NFB$out_ring$NFE calls ringing         \n"; + echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + } + else + { + echo "KEIN PHASENCANKLOPFEN\n"; + } + + +################################################################################### +###### TIME ON SYSTEM +################################################################################### + +$agent_incall=0; +$agent_ready=0; +$agent_paused=0; +$agent_total=0; + +$Aecho = ''; +$Aecho .= "VF DIALER: Agents Time On Calls Kampagne: $group $NOW_TIME\n\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; +$Aecho .= "| STATION | USER | FULL NAME | SESSIONID | BARGE | STATUS | BEDIENERIP | CALL BEDIENERIP | MM:SS | CAMPAIGN |\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; + + +$stmt=" + select + extension, + vicidial_live_agents.user, + conf_exten, + status, + server_ip, + UNIX_TIMESTAMP(last_call_time), + UNIX_TIMESTAMP(last_call_finish), + call_server_ip, + campaign_id, + vicidial_users.full_name as full_name + from vicidial_live_agents + left join vicidial_users on vicidial_live_agents.user = vicidial_users.user + where + campaign_id='" . mysql_real_escape_string($group) . "' + order by + status, + last_call_time; +"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + $agentcount=0; + while ($i < $talking_to_print) + { + $row=mysql_fetch_row($rslt); + if (eregi("READY|PAUSED",$row[4])) + { + $row[5]=$row[6]; + } + $extension = sprintf("%-10s", $row[0]); + $user = sprintf("%-6s", $row[1]); + $sessionid = sprintf("%-9s", $row[2]); + $status = sprintf("%-6s", $row[3]); + $server_ip = sprintf("%-15s", $row[4]); + $call_server_ip = sprintf("%-15s", $row[7]); + $campaign_id = sprintf("%-10s", $row[8]); + $full_name = sprintf("%-15s", $row[9]); + while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);} + $call_time_S = ($STARTtime - $row[5]); + + $call_time_M = ($call_time_S / 60); + $call_time_M = round($call_time_M, 2); + $call_time_M_int = intval("$call_time_M"); + $call_time_SEC = ($call_time_M - $call_time_M_int); + $call_time_SEC = ($call_time_SEC * 60); + $call_time_SEC = round($call_time_SEC, 0); + if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} + $call_time_MS = "$call_time_M_int:$call_time_SEC"; + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + if ($call_time_M_int >= 5) {$G=''; $EG='';} +# if ($call_time_M_int >= 10) {$G=''; $EG='';} + if (eregi("PAUSED",$row[3])) + { + if ($call_time_M_int >= 20) + {$i++; continue;} + else + {$G=''; $EG=''; $agent_paused++; $agent_total++;} + } +# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) +# {$G=''; $EG='';} + + if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} + $sessionid = trim($sessionid); + + $agentcount++; + $Aecho .= "| $G$extension$EG | $G$user$EG | $G$full_name$EG | $G$sessionid$EG LISTEN | BARGE | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; + + $i++; + } + + $Aecho .= "+------------|--------+-----------------+----------------+--------+--------+-----------------+-----------------+---------+------------+\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " NOTE: Click LISTEN to monitor agent call, you must have installed softphone on you machine.\n\n"; + + + $Aecho .= " - Pausierte Mittel\n"; + # $Aecho .= " - Balanced call\n"; + $Aecho .= " - Agent waiting for call\n"; + $Aecho .= " - Over 5 minutes on call\n"; + $Aecho .= " - Über 10 Minuten beim Anruf\n"; + if ($agent_ready > 0) {$B=''; $BG='';} + if ($agent_ready > 4) {$B=''; $BG='';} + if ($agent_ready > 9) {$B=''; $BG='';} + if ($agent_ready > 14) {$B=''; $BG='';} + + + echo "\n
\n"; + + echo "$NFB$agent_total$NFE agents logged in         \n"; + + echo "$NFB$agent_incall$NFE agents in calls       \n"; + echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; + echo "$NFB$agent_paused$NFE paused agents       \n"; + + echo "
";
+		echo "";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo "KEINE MITTEL BEI DEN ANRUFEN\n";
+	}
+
+?>
+
+ + + + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/admin.php b/agc_2-X/trunk/LANG_www/vicidial_de/admin.php index 67d396e3..05d5c4a2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/admin.php @@ -274,6 +274,25 @@ if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} +if (isset($_GET["allcalls_delay"])) {$allcalls_delay=$_GET["allcalls_delay"];} + elseif (isset($_POST["allcalls_delay"])) {$allcalls_delay=$_POST["allcalls_delay"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} +if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} + elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} +if (isset($_GET["adaptive_dropped_percentage"])) {$adaptive_dropped_percentage=$_GET["adaptive_dropped_percentage"];} + elseif (isset($_POST["adaptive_dropped_percentage"])){$adaptive_dropped_percentage=$_POST["adaptive_dropped_percentage"];} +if (isset($_GET["available_only_ratio_tally"])) {$available_only_ratio_tally=$_GET["available_only_ratio_tally"];} + elseif (isset($_POST["available_only_ratio_tally"])){$available_only_ratio_tally=$_POST["available_only_ratio_tally"];} +if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} + elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} +if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$_GET["adaptive_latest_server_time"];} + elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} +if (isset($_GET["adaptive_intensity"])) {$adaptive_intensity=$_GET["adaptive_intensity"];} + elseif (isset($_POST["adaptive_intensity"])) {$adaptive_intensity=$_POST["adaptive_intensity"];} +if (isset($_GET["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_GET["adaptive_dl_diff_target"];} + elseif (isset($_POST["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_POST["adaptive_dl_diff_target"];} + if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -283,8 +302,6 @@ if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum ### DIGITS ONLY ### $user_level = ereg_replace("[^0-9]","",$user_level); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); @@ -344,6 +361,9 @@ $attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); $attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); $hotkey = ereg_replace("[^0-9]","",$hotkey); $list_id = ereg_replace("[^0-9]","",$list_id); +$allcalls_delay = ereg_replace("[^0-9]","",$allcalls_delay); +$adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage); +$adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -357,6 +377,8 @@ $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); $drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code); +$available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally); ### ALPHA-NUMERIC ONLY ### $user = ereg_replace("[^0-9a-zA-Z]","",$user); @@ -377,10 +399,15 @@ $scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); +$adaptive_maximum_level = ereg_replace("[^\.0-9]","",$adaptive_maximum_level); -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); +### ALPHA-NUMERIC and spaces and hash and star and comma +$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); +$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf); + +### ALPHACAPS-NUMERIC +$xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); +$xferconf_b_number = ereg_replace("[^0-9A-Z]","",$xferconf_b_number); ### ALPHA-NUMERIC and underscore and dash $dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); @@ -402,6 +429,7 @@ $group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); $user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); $OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); $state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); +$dial_method = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_method); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -424,6 +452,8 @@ $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comm $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); +$adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); +$adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); @@ -493,13 +523,23 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 60613-1415 - Added lead recycling options to campaign detail screen # 60619-1523 - Added variable filtering to eliminate SQL injection attack threat # 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug +# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug +# 60808-1147 - changed filtering for and added instructions for consutative transfers +# 60816-1552 - added allcalls_delay start delay for recordings in vicidial.php +# 60817-2226 - fixed bug that would not allow lead recycling of non-selectable statuses +# 60821-1543 - added option to Omit Phone Code while dialing in vicidial +# 60821-1625 - added ALLFORCE recording option for campaign_recording +# 60823-1154 - added fields for adaptive dialing +# 60824-1326 - added adaptive_latest_target_gmt for ADAPT_TAPERED dial method +# 60825-1205 - added adaptive_intensity for ADAPT_ dial methods +# 60828-1019 - changed adaptive_latest_target_gmt to adaptive_latest_server_time +# 60828-1115 - added adaptive_dl_diff_target and changed intensity dropdown # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$version = '1.1.12-3'; -$build = '60623-1159'; +$version = '2.0.65'; +$build = '60828-1115'; $STARTtime = date("U"); @@ -1076,11 +1116,46 @@ echo "
Kraft-Zurückstellen des Zufuhrbehälters - erlaubt dieses Ihnen,aus dem Zufuhrbehälterinhalt nach Formunterordnung abzuwischen. Essollte wieder gefüllt werden, wenn der VDhopper Index läuft. +
+ +
+Dial Method - This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift(as defined by call_time selected for campaign) and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. +

Selbstvorwahlknopf-Niveau - Dieses ist, wohin Sie einstellen,wieviele VICIDIAL sollte pro Mittel 0 verwenden des aktiven Mittelsnull zeichnet, Automobil, daswählen aus ist und die Mittel klicken,um jede Nummer zu wählen. Andernfalls hält VICIDIALWählverbindungen gleich den aktiven Mitteln, die mit demVorwahlknopfniveau multipliziert werden, um zu, wievielen Linien zukommen diese Kampagne auf jedem Bediener erlauben sollte. +
+
+
+Available Only Tally - This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N. + +
+
+
+Drop Percentage Limit - This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO. + +
+
+
+Maximum Adapt Dial Level - This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Selbstvorwahlknopf-Niveau if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0. + +
+
+
+Latest Server Time - This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling. + +
+
+
+Adapt Intensity Modifier - This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods. + +
+
+
+Dial Level Difference Target - This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or RATIO dial methods. +

@@ -1105,6 +1180,11 @@ echo "
Vorwahlknopf-Präfix - Dieses fangen zuläßt einen Wegdes Wählens leicht ändern auf, zum durch eine andere Methode zuerlöschen, ohne ein Umladen im Sternchen zu tun. Rückstellung ist 9gegründet nach einem 91NXXNXXXXXX im dialplan - extensions.conf. +
+ +
+Omit Phone Code - This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dialplan extensions.conf to place calls instead of 44 then 10 digits. Default is N. +

@@ -1123,13 +1203,18 @@ echo "

-Kampagne Aufnahme - Dieses Menü erlaubt Ihnen, zu wählen,welches Niveau der Aufnahme auf dieser Kampagne erlaubt wird. NIEsperrt Aufnahme auf dem Klienten. ONDEMAND ist die Rückstellung underlaubt dem Vertreter zu notieren zu beginnen und, zu stoppen, wiegebraucht. ALLCALLS beginnt Aufnahme auf dem Klienten, wann immer einAnruf zu einem Mittel geschickt wird. +Kampagne Aufnahme - Dieses Menü erlaubt Ihnen, zu wählen,welches Niveau der Aufnahme auf dieser Kampagne erlaubt wird. NIEsperrt Aufnahme auf dem Klienten. ONDEMAND ist die Rückstellung underlaubt dem Vertreter zu notieren zu beginnen und, zu stoppen, wiegebraucht. ALLCALLS beginnt Aufnahme auf dem Klienten, wann immer einAnruf zu einem Mittel geschickt wird. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load.

Kampagne Rec Dateiname - Dieses fangen erlaubt Ihnen, denNamen der Aufnahme besonders anzufertigen auf, wenn Kampagne AufnahmeONDEMAND oder ALLCALLS ist. Die erlaubten Variablen sind KAMPAGNECUSTPHONE FULLDATE TINYDATE EPOCHE-MITTEL. Die Rückstellung istFULLDATE_MITTELund würde wie dieses 20051020-103108_6666 aussehen.Ein anderes Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE, das wie diesesTESTCAMP_51020103108_3125551212 aussehen würde. 50 char max. +
+
+
+Recording Delay - For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0. +

@@ -1153,7 +1238,7 @@ echo "

-Xfer-Conf DTMF - Diese vier fängt dürfen auf, damit Siezwei Sätze Übergangskonferenz und DTMF Voreinstellungen haben. Wennder Anruf oder die Kampagne geladen wird, stellt der vicidial.phpIndex dar, daß zwei Tasten auf dem Bringenkonferenz Rahmen und denZahl-zu-Vorwahlknopf und senden-dtmf Automobil-zu bevölkernauffängt, wenn sie betätigt werden. +Xfer-Conf DTMF - Diese vier fängt dürfen auf, damit Siezwei Sätze Übergangskonferenz und DTMF Voreinstellungen haben. Wennder Anruf oder die Kampagne geladen wird, stellt der vicidial.phpIndex dar, daß zwei Tasten auf dem Bringenkonferenz Rahmen und denZahl-zu-Vorwahlknopf und senden-dtmf Automobil-zu bevölkernauffängt, wenn sie betätigt werden. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1300,7 +1385,7 @@ echo "

-Xfer-Conf DTMF - Diese vier fängt dürfen auf, damit Siezwei Sätze Übergangskonferenz und DTMF Voreinstellungen haben. Wennder Anruf oder die Kampagne geladen wird, stellt der vicidial.phpIndex dar, daß zwei Tasten auf dem Bringenkonferenz Rahmen und denZahl-zu-Vorwahlknopf und senden-dtmf Automobil-zu bevölkernauffängt, wenn sie betätigt werden. +Xfer-Conf DTMF - Diese vier fängt dürfen auf, damit Siezwei Sätze Übergangskonferenz und DTMF Voreinstellungen haben. Wennder Anruf oder die Kampagne geladen wird, stellt der vicidial.phpIndex dar, daß zwei Tasten auf dem Bringenkonferenz Rahmen und denZahl-zu-Vorwahlknopf und senden-dtmf Automobil-zu bevölkernauffängt, wenn sie betätigt werden. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1965,7 +2050,7 @@ if (strlen($phone_number) > 2) echo "
FÜGEN Sie Eine ZAHL Der DNC LISTE Hinzu
\n"; echo "\n"; echo "
\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Telefonnummer: (nur Stellen)$NWB#vicidial_list-dnc$NWE
Telefonnummer: (nur Stellen)$NWB#vicidial_list-dnc$NWE
\n"; @@ -2813,7 +2898,29 @@ if ($ADD==41) { echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -2928,7 +3035,29 @@ if ($ADD==44) { echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -4215,6 +4344,15 @@ echo "\n"; @@ -4290,7 +4432,58 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + + + +echo "\n"; + echo "\n"; @@ -4303,16 +4496,20 @@ echo "\n"; +echo "\n"; + echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; +echo "\n"; + echo "
\n"; $wrapup_message = $row[41]; # $closer_campaigns = $row[42]; $use_internal_dnc = $row[43]; + $allcalls_delay = $row[44]; + $omit_phone_code = $row[45]; + $dial_method = $row[46]; + $available_only_ratio_tally = $row[47]; + $adaptive_dropped_percentage = $row[48]; + $adaptive_maximum_level = $row[49]; + $adaptive_latest_server_time = $row[50]; + $adaptive_intensity = $row[51]; + $adaptive_dl_diff_target = $row[52]; echo "
ÄNDERN Sie Einen KAMPAGNEN SATZ: $row[0] - Grundlegende Ansicht"; echo " | Detail-Ansicht | "; @@ -4237,28 +4375,32 @@ echo "
Vorwahlknopfstatus1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' and selectable='Y' order by status"; + $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Zufuhrbehälter-Niveau: Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Available Only Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Drop Percentage Limit: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Maximum Adapt Dial Level: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Latest Server Time: 4 nur Stellen $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Dial Level Difference Target: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
Vorwahlknopf-Abschaltung: Vorwahlknopf-Präfix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omit Phone Code: $NWB#vicidial_campaigns-omit_phone_code$NWE
Kampagne CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Kampagne VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Kampagne Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Kampagne Aufnahme: $NWB#vicidial_campaigns-campaign_recording$NWE
Kampagne Aufnahme: $NWB#vicidial_campaigns-campaign_recording$NWE
Kampagne Rec Dateiname: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Recording Delay: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: \n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "Versuch Verzögert: \n"; echo "Versuch Maximum: \n"; @@ -4612,6 +4809,8 @@ echo "\n"; @@ -4683,7 +4884,24 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php index 1662f18f..7221b35e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_de/dbconnect.php @@ -1,15 +1,48 @@ LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; - -$WeBServeRRooT = '/usr/local/apache2/htdocs'; $WeBRooTWritablE = '1'; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDAD_closer.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDAD_closer.php index 07234545..c1cefdca 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDAD_closer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDAD_closer.php @@ -173,7 +173,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $ext_count) { - $stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; + $stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $camp_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php index ac70cbdc..1608a95a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/AST_timeonVDADall.php @@ -13,6 +13,7 @@ # 60608-1539 - Fixed CLOSER tallies for active calls # 60619-1658 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 60626-1453 - Added display of system load to bottom (Angelito Manansala) # header ("Content-type: text/html; charset=utf-8"); @@ -39,6 +40,46 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" if (!isset($group)) {$group='';} +function get_server_load($windows = false) { +$os = strtolower(PHP_OS); +if(strpos($os, "win") === false) { +if(file_exists("/proc/loadavg")) { +$load = file_get_contents("/proc/loadavg"); +$load = explode(' ', $load); +return $load[0]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $load[count($load)-1]; +} +else { +return false; +} +} +elseif($windows) { +if(class_exists("COM")) { +$wmi = new COM("WinMgmts:\\\\."); +$cpus = $wmi->InstancesOf("Win32_Processor"); + +$cpuload = 0; +$i = 0; +while ($cpu = $cpus->Next()) { +$cpuload += $cpu->LoadPercentage; +$i++; +} + +$cpuload = round($cpuload / $i, 2); +return "$cpuload%"; +} +else { +return false; +} +} +} + +$load_ave = get_server_load(true); + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -139,10 +180,11 @@ echo "\n\n"; if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} else { -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $HOPlev = $row[8]; +$DIALmethod = $row[9]; echo "
\n"; $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $display_dialable_count = $row[39]; + $dial_method = $row[46]; + $adaptive_intensity = $row[51]; echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Grundlegende Ansicht | "; echo "Detail-Ansicht | "; @@ -4634,24 +4833,26 @@ echo "
Vorwahlknopfstatus1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Zufuhrbehälter-Niveau: Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
"; echo ""; @@ -156,13 +198,21 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct,differential_onemin,agents_average_onemin from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $DAleads = $row[0]; $callsTODAY = $row[1]; $dropsTODAY = $row[2]; $drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; +$agentsONEMIN = $row[5]; +if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } +else {$diffpctONEMIN = '0.00';} echo ""; echo ""; @@ -175,6 +225,13 @@ echo ""; echo ""; echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + echo "
DIAL LEVEL:  $row[0]   
HOPPER LEVEL:  $HOPlev     CALLS TODAY:CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
DIAL METHOD:  $DIALmethod     DL DIFF:  $diffONEMIN     AVG AGENTS:  $agentsONEMIN     DIFF:  $diffpctONEMIN%    
"; @@ -295,7 +352,7 @@ $talking_to_print = mysql_num_rows($rslt); # if ($call_time_M_int >= 10) {$G=''; $EG='';} if (eregi("PAUSED",$row[3])) { - if ($call_time_M_int >= 1) + if ($call_time_M_int >= 5) {$i++; continue;} else {$G=''; $EG=''; $agent_paused++; $agent_total++;} @@ -314,7 +371,8 @@ $talking_to_print = mysql_num_rows($rslt); } $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " System Load Average: $load_ave\n\n"; $Aecho .= " - Χειριστές σε παύση\n"; # $Aecho .= " - Balanced call\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/admin.php b/agc_2-X/trunk/LANG_www/vicidial_el/admin.php index 1419fe6e..b6aac13d 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/admin.php @@ -274,6 +274,25 @@ if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} +if (isset($_GET["allcalls_delay"])) {$allcalls_delay=$_GET["allcalls_delay"];} + elseif (isset($_POST["allcalls_delay"])) {$allcalls_delay=$_POST["allcalls_delay"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} +if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} + elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} +if (isset($_GET["adaptive_dropped_percentage"])) {$adaptive_dropped_percentage=$_GET["adaptive_dropped_percentage"];} + elseif (isset($_POST["adaptive_dropped_percentage"])){$adaptive_dropped_percentage=$_POST["adaptive_dropped_percentage"];} +if (isset($_GET["available_only_ratio_tally"])) {$available_only_ratio_tally=$_GET["available_only_ratio_tally"];} + elseif (isset($_POST["available_only_ratio_tally"])){$available_only_ratio_tally=$_POST["available_only_ratio_tally"];} +if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} + elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} +if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$_GET["adaptive_latest_server_time"];} + elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} +if (isset($_GET["adaptive_intensity"])) {$adaptive_intensity=$_GET["adaptive_intensity"];} + elseif (isset($_POST["adaptive_intensity"])) {$adaptive_intensity=$_POST["adaptive_intensity"];} +if (isset($_GET["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_GET["adaptive_dl_diff_target"];} + elseif (isset($_POST["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_POST["adaptive_dl_diff_target"];} + if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -283,8 +302,6 @@ if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum ### DIGITS ONLY ### $user_level = ereg_replace("[^0-9]","",$user_level); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); @@ -344,6 +361,9 @@ $attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); $attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); $hotkey = ereg_replace("[^0-9]","",$hotkey); $list_id = ereg_replace("[^0-9]","",$list_id); +$allcalls_delay = ereg_replace("[^0-9]","",$allcalls_delay); +$adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage); +$adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -357,6 +377,8 @@ $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); $drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code); +$available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally); ### ALPHA-NUMERIC ONLY ### $user = ereg_replace("[^0-9a-zA-Z]","",$user); @@ -377,10 +399,15 @@ $scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); +$adaptive_maximum_level = ereg_replace("[^\.0-9]","",$adaptive_maximum_level); -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); +### ALPHA-NUMERIC and spaces and hash and star and comma +$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); +$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf); + +### ALPHACAPS-NUMERIC +$xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); +$xferconf_b_number = ereg_replace("[^0-9A-Z]","",$xferconf_b_number); ### ALPHA-NUMERIC and underscore and dash $dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); @@ -402,6 +429,7 @@ $group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); $user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); $OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); $state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); +$dial_method = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_method); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -424,6 +452,8 @@ $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comm $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); +$adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); +$adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); @@ -493,13 +523,23 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 60613-1415 - Added lead recycling options to campaign detail screen # 60619-1523 - Added variable filtering to eliminate SQL injection attack threat # 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug +# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug +# 60808-1147 - changed filtering for and added instructions for consutative transfers +# 60816-1552 - added allcalls_delay start delay for recordings in vicidial.php +# 60817-2226 - fixed bug that would not allow lead recycling of non-selectable statuses +# 60821-1543 - added option to Omit Phone Code while dialing in vicidial +# 60821-1625 - added ALLFORCE recording option for campaign_recording +# 60823-1154 - added fields for adaptive dialing +# 60824-1326 - added adaptive_latest_target_gmt for ADAPT_TAPERED dial method +# 60825-1205 - added adaptive_intensity for ADAPT_ dial methods +# 60828-1019 - changed adaptive_latest_target_gmt to adaptive_latest_server_time +# 60828-1115 - added adaptive_dl_diff_target and changed intensity dropdown # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$version = '1.1.12-3'; -$build = '60623-1159'; +$version = '2.0.65'; +$build = '60828-1115'; $STARTtime = date("U"); @@ -1076,11 +1116,46 @@ echo "
Υποχρεωτική Επαναφορά του Hopper - Αυτό σας επιτρέπει καθαρίσετε τα περιεχόμενα κατά την επιβεβαίωση της φόρμας. Αυτό θα συμβεί πάλι όταν η διαδικασία VDhopper θα τρέξει. +
+ +
+Dial Method - This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift(as defined by call_time selected for campaign) and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. +

Επίπεδο Αυτόματης Κλήσης - Εδώ είναι που καθορίζεται πόσες γραμμές θα χρησιμοποιούνται ανά ενεργό χρήστη. Μηδέν (0) σημαίνει ότι η αυτόματη κλήση είναι μη ενεργή και οι χρήστες πατούν το πλήκτρο για την κλήση κάθε αριθμού. Διαφορετικά, το σύστημα καλεί γραμμές ίσες με τους ενεργούς χρήστες, πολλαπλασιασμένους με το επίπεδο κλήσης και σύμφωνα με το πόσες γραμμές η εκστρατεία σε κάθε διακομιστή επιτρέπει. +
+
+
+Available Only Tally - This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N. + +
+
+
+Drop Percentage Limit - This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO. + +
+
+
+Maximum Adapt Dial Level - This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0. + +
+
+
+Latest Server Time - This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling. + +
+
+
+Adapt Intensity Modifier - This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods. + +
+
+
+Dial Level Difference Target - This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or RATIO dial methods. +

@@ -1105,6 +1180,11 @@ echo "
Πρόθεμα Κλήσης - Αυτό το ο επιτρέπει την πιο εύκολη αλλαγή της διαδρομής της κλήσης να βγει έξω μέσω διαφορετικής μεθόδου, χωρίς να γίνει επαναφόρτωση στο Asterisk. Προκαθορισμένο είναι το 9 βασισμένο σύμφωνα με το 91NXXNXXXXXX στο σχέδιο κλήσεων - extensions.conf. +
+ +
+Omit Phone Code - This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dialplan extensions.conf to place calls instead of 44 then 10 digits. Default is N. +

@@ -1123,13 +1203,18 @@ echo "

-Ηχογράφηση εκστρατείας - αυτή η επιλογή επιτρέπει να επιλέξετε το επίπεδο ηχογράφησης σε αυτήν την εκστρατεία. NEVER θα θέσει εκτός λειτουργίας την ηχογράφηση στον πελάτη. ONDEMAND είναι η προεπιλογή και επιτρέπει στον χειριστή να αρχίσει και να σταματήσει όπως απαιτείται. ALLCALLS θα αρχίσει την καταγραφή στον πελάτη όποτε μια κλήση στέλνεται σε έναν χειριστή. +Ηχογράφηση εκστρατείας - αυτή η επιλογή επιτρέπει να επιλέξετε το επίπεδο ηχογράφησης σε αυτήν την εκστρατεία. NEVER θα θέσει εκτός λειτουργίας την ηχογράφηση στον πελάτη. ONDEMAND είναι η προεπιλογή και επιτρέπει στον χειριστή να αρχίσει και να σταματήσει όπως απαιτείται. ALLCALLS θα αρχίσει την καταγραφή στον πελάτη όποτε μια κλήση στέλνεται σε έναν χειριστή. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load.

Όνομα αρχείου ηχογρ εκστρατείας - αυτό το πεδίο επιτρέπει να προσαρμόσετε το όνομα της ηχογράφησης, όταν η ηχογράφηση της εκστρατείας είναι ONDEMAND ή ALLCALLS. Οι μεταβλητές είναι CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. Η προεπιλογή είναι FULLDATE_ΧΕΙΡΙΣΤΗΣκαι θα μοιάζει με το 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει με το TESTCAMP_51020103108_3125551212. 50 char max. +
+
+
+Recording Delay - For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0. +

@@ -1153,7 +1238,7 @@ echo "

-Xfer- Συνδ DTMF - αυτά τα τέσσερα πεδία επιτρέπουν να έχετε δύο σύνολα συνδιάσκεψης μεταφοράς και DTMF. Όταν η κλήση ή η εκστρατεία φορτώνεται, ο Βοηθός θα παρουσιάσει δύο πλήκτρα στο πλαίσιο μεταφορά-διασκέψεων και αυτόματα θα παρουσιάσει τα πεδία αριθμό για κλήση και στείλε DTMF όταν πατηθεί. +Xfer- Συνδ DTMF - αυτά τα τέσσερα πεδία επιτρέπουν να έχετε δύο σύνολα συνδιάσκεψης μεταφοράς και DTMF. Όταν η κλήση ή η εκστρατεία φορτώνεται, ο Βοηθός θα παρουσιάσει δύο πλήκτρα στο πλαίσιο μεταφορά-διασκέψεων και αυτόματα θα παρουσιάσει τα πεδία αριθμό για κλήση και στείλε DTMF όταν πατηθεί. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1300,7 +1385,7 @@ echo "

-Xfer- Συνδ DTMF - αυτά τα τέσσερα πεδία επιτρέπουν να έχετε δύο σύνολα συνδιάσκεψης μεταφοράς και DTMF. Όταν η κλήση ή η εκστρατεία φορτώνεται, ο Βοηθός θα παρουσιάσει δύο πλήκτρα στο πλαίσιο μεταφορά-διασκέψεων και αυτόματα θα παρουσιάσει τα πεδία αριθμό για κλήση και στείλε DTMF όταν πατηθεί. +Xfer- Συνδ DTMF - αυτά τα τέσσερα πεδία επιτρέπουν να έχετε δύο σύνολα συνδιάσκεψης μεταφοράς και DTMF. Όταν η κλήση ή η εκστρατεία φορτώνεται, ο Βοηθός θα παρουσιάσει δύο πλήκτρα στο πλαίσιο μεταφορά-διασκέψεων και αυτόματα θα παρουσιάσει τα πεδία αριθμό για κλήση και στείλε DTMF όταν πατηθεί. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1965,7 +2050,7 @@ if (strlen($phone_number) > 2) echo "
ΠΡΟΣΘΕΣΤΕ έναν ΑΡΙΘΜΟ στον ΚΑΤΑΛΟΓΟ DNC
\n"; echo "\n"; echo "
\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Τηλεφωνικός αριθμός: (μόνο αριθμοί)$NWB#vicidial_list-dnc$NWE
Τηλεφωνικός αριθμός: (μόνο αριθμοί)$NWB#vicidial_list-dnc$NWE
\n"; @@ -2813,7 +2898,29 @@ if ($ADD==41) { echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -2928,7 +3035,29 @@ if ($ADD==44) { echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -4215,6 +4344,15 @@ echo " $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' and selectable='Y' order by status"; + $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE\n"; @@ -4290,7 +4432,58 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + + + +echo "\n"; + echo "\n"; @@ -4303,16 +4496,20 @@ echo "\n"; +echo "\n"; + echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; +echo "\n"; + echo "
\n"; $wrapup_message = $row[41]; # $closer_campaigns = $row[42]; $use_internal_dnc = $row[43]; + $allcalls_delay = $row[44]; + $omit_phone_code = $row[45]; + $dial_method = $row[46]; + $available_only_ratio_tally = $row[47]; + $adaptive_dropped_percentage = $row[48]; + $adaptive_maximum_level = $row[49]; + $adaptive_latest_server_time = $row[50]; + $adaptive_intensity = $row[51]; + $adaptive_dl_diff_target = $row[52]; echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΕΚΣΤΡΑΤΕΙΩΝ: $row[0] - Βασική Επισκόπηση"; echo " | Αναλυτική Επισκόπηση | "; @@ -4237,28 +4375,32 @@ echo "
Κατάσταση κλήσης1:
Επίπεδο Hopper: Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Available Only Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Drop Percentage Limit: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Maximum Adapt Dial Level: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Latest Server Time: 4 μόνο αριθμοί $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Dial Level Difference Target: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
Κλήση εκτός χρόνου: Πρόθεμα Κλήσης: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omit Phone Code: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID Εκστρατείας: $NWB#vicidial_campaigns-campaign_cid$NWE
Εκστρατείας VDAD εσωτ.σύνδεση: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Επέκταση εκστρατείας Ηχογρ: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Ηχογράφηση εκστρατείας: $NWB#vicidial_campaigns-campaign_recording$NWE
Ηχογράφηση εκστρατείας: $NWB#vicidial_campaigns-campaign_recording$NWE
Όνομα αρχείου εκστρατείας Ηχογρ: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Recording Delay: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: \n"; echo "\n"; echo "\n"; echo "Κατάσταση:   \n"; echo "Καθυστέρηση προσπάθειας: \n"; echo "Μέγιστο προσπάθειας: \n"; @@ -4612,6 +4809,8 @@ echo " $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE\n"; @@ -4683,7 +4884,24 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php index fb6d5917..7221b35e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_el/dbconnect.php @@ -1,16 +1,48 @@ LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } -$link=mysql_connect("10.10.11.10", "astcron", "astcron"); -mysql_select_db("asterisk"); +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; - -$WeBServeRRooT = '/home/www/htdocs'; -#$WeBServeRRooT = '/usr/local/apache2/htdocs'; $WeBRooTWritablE = '1'; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_el/htglobalize.php b/agc_2-X/trunk/LANG_www/vicidial_el/htglobalize.php deleted file mode 100644 index 72a10e1f..00000000 --- a/agc_2-X/trunk/LANG_www/vicidial_el/htglobalize.php +++ /dev/null @@ -1,23 +0,0 @@ - $value){ - ${$key} = $value; - global ${$key};// = $value; - } - -} -array_conv($_GET); -array_conv($_POST); -array_conv($_SERVER); - -?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDAD_closer.php b/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDAD_closer.php index eb7d3c39..f8ba16b0 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDAD_closer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDAD_closer.php @@ -173,7 +173,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $ext_count) { - $stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; + $stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $camp_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall.php index 540a5eb6..4cf25f00 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall.php @@ -13,6 +13,7 @@ # 60608-1539 - Fixed CLOSER tallies for active calls # 60619-1658 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 60626-1453 - Added display of system load to bottom (Angelito Manansala) # header ("Content-type: text/html; charset=utf-8"); @@ -39,6 +40,46 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (!isset($group)) {$group='';} +function get_server_load($windows = false) { +$os = strtolower(PHP_OS); +if(strpos($os, "win") === false) { +if(file_exists("/proc/loadavg")) { +$load = file_get_contents("/proc/loadavg"); +$load = explode(' ', $load); +return $load[0]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $load[count($load)-1]; +} +else { +return false; +} +} +elseif($windows) { +if(class_exists("COM")) { +$wmi = new COM("WinMgmts:\\\\."); +$cpus = $wmi->InstancesOf("Win32_Processor"); + +$cpuload = 0; +$i = 0; +while ($cpu = $cpus->Next()) { +$cpuload += $cpu->LoadPercentage; +$i++; +} + +$cpuload = round($cpuload / $i, 2); +return "$cpuload%"; +} +else { +return false; +} +} +} + +$load_ave = get_server_load(true); + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -139,10 +180,11 @@ echo "\n\n"; if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} else { -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $HOPlev = $row[8]; +$DIALmethod = $row[9]; echo "
\n"; $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $display_dialable_count = $row[39]; + $dial_method = $row[46]; + $adaptive_intensity = $row[51]; echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Βασική Επισκόπηση | "; echo "Αναλυτική Επισκόπηση | "; @@ -4634,24 +4833,26 @@ echo "
Κατάσταση κλήσης1:
Επίπεδο Hopper: Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
"; echo ""; @@ -156,13 +198,21 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct,differential_onemin,agents_average_onemin from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $DAleads = $row[0]; $callsTODAY = $row[1]; $dropsTODAY = $row[2]; $drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; +$agentsONEMIN = $row[5]; +if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } +else {$diffpctONEMIN = '0.00';} echo ""; echo ""; @@ -175,6 +225,13 @@ echo ""; echo ""; echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + echo "
DIAL LEVEL:  $row[0]   
HOPPER LEVEL:  $HOPlev     CALLS TODAY:CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
DIAL METHOD:  $DIALmethod     DL DIFF:  $diffONEMIN     AVG AGENTS:  $agentsONEMIN     DIFF:  $diffpctONEMIN%    
"; @@ -295,7 +352,7 @@ $talking_to_print = mysql_num_rows($rslt); # if ($call_time_M_int >= 10) {$G=''; $EG='';} if (eregi("PAUSED",$row[3])) { - if ($call_time_M_int >= 1) + if ($call_time_M_int >= 5) {$i++; continue;} else {$G=''; $EG=''; $agent_paused++; $agent_total++;} @@ -314,7 +371,8 @@ $talking_to_print = mysql_num_rows($rslt); } $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " System Load Average: $load_ave\n\n"; $Aecho .= " - Paused agents\n"; # $Aecho .= " - Balanced call\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall_SIPmonitor.php b/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall_SIPmonitor.php index 0b24f82e..355a6fcd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall_SIPmonitor.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/AST_timeonVDADall_SIPmonitor.php @@ -1,301 +1,323 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - - - - - - + LICENSE: GPLv2 +### Contributions by Magma Networks LLC +### +# live real-time stats for the VICIDIAL Auto-Dialer all servers +# +# changes: +# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) +# 51130-1218 - Modified layout and info to show all servers in a vicidial system +# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala +# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# - Added 10 minutes on call (Magma Networks LLC) +# - Added extended pause (exceeding 60 seconds -> 20 minutes) (Magma Networks LLC) +# - Added Full Name Field to extract from Database (Magma Networks LLC) +# - Added Barge Link (Magma Networks LLC) +# 60731-1138 - fixed fullname formatting + +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} +$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} +$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} +$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} +$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} +$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} +$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$stmt="select campaign_id from vicidial_campaigns;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } + +if (!$RR) {$RR=40;} + +$NFB = ''; +$NFE = ''; +$F=''; $FG=''; $B=''; $BG=''; +$reset_counter++; + +if ($reset_counter > 7) + { + $reset_counter=0; + } + +?> + + + + + +\n"; +echo"\n"; +echo "VICIDIAL: Time On VDAD Campaign: $group\n"; +echo "
\n"; +echo "VICIDIAL: Realtime Campaign: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "         \n"; +echo "STOP | GO"; +echo "         MODIFY | REPORTS \n"; +echo "\n\n"; + +if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); + +echo "
"; +echo "DIAL LEVEL: $row[0]         "; +echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; +echo "ORDER: $row[6]"; +echo "\n\n"; +} +################################################################################### +###### OUTBOUND CALLS +################################################################################### +if (eregi("CLOSER",$group)) + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} +else + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + {$out_live++;} + else + { + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + $out_total++; + $i++; + } + + if ($out_live > 0) {$F=''; $FG='';} + if ($out_live > 4) {$F=''; $FG='';} + if ($out_live > 9) {$F=''; $FG='';} + if ($out_live > 14) {$F=''; $FG='';} + + if (eregi("CLOSER",$group)) + {echo "$NFB$out_total$NFE current active calls      \n";} + else + {echo "$NFB$out_total$NFE calls being placed       \n";} + + echo "$NFB$out_ring$NFE calls ringing         \n"; + echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + } + else + { + echo " NO LIVE CALLS WAITING \n"; + } + + +################################################################################### +###### TIME ON SYSTEM +################################################################################### + +$agent_incall=0; +$agent_ready=0; +$agent_paused=0; +$agent_total=0; + +$Aecho = ''; +$Aecho .= "VF DIALER: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; +$Aecho .= "| STATION | USER | FULL NAME | SESSIONID | BARGE | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; + + +$stmt=" + select + extension, + vicidial_live_agents.user, + conf_exten, + status, + server_ip, + UNIX_TIMESTAMP(last_call_time), + UNIX_TIMESTAMP(last_call_finish), + call_server_ip, + campaign_id, + vicidial_users.full_name as full_name + from vicidial_live_agents + left join vicidial_users on vicidial_live_agents.user = vicidial_users.user + where + campaign_id='" . mysql_real_escape_string($group) . "' + order by + status, + last_call_time; +"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + $agentcount=0; + while ($i < $talking_to_print) + { + $row=mysql_fetch_row($rslt); + if (eregi("READY|PAUSED",$row[4])) + { + $row[5]=$row[6]; + } + $extension = sprintf("%-10s", $row[0]); + $user = sprintf("%-6s", $row[1]); + $sessionid = sprintf("%-9s", $row[2]); + $status = sprintf("%-6s", $row[3]); + $server_ip = sprintf("%-15s", $row[4]); + $call_server_ip = sprintf("%-15s", $row[7]); + $campaign_id = sprintf("%-10s", $row[8]); + $full_name = sprintf("%-15s", $row[9]); + while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);} + $call_time_S = ($STARTtime - $row[5]); + + $call_time_M = ($call_time_S / 60); + $call_time_M = round($call_time_M, 2); + $call_time_M_int = intval("$call_time_M"); + $call_time_SEC = ($call_time_M - $call_time_M_int); + $call_time_SEC = ($call_time_SEC * 60); + $call_time_SEC = round($call_time_SEC, 0); + if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} + $call_time_MS = "$call_time_M_int:$call_time_SEC"; + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + if ($call_time_M_int >= 5) {$G=''; $EG='';} +# if ($call_time_M_int >= 10) {$G=''; $EG='';} + if (eregi("PAUSED",$row[3])) + { + if ($call_time_M_int >= 20) + {$i++; continue;} + else + {$G=''; $EG=''; $agent_paused++; $agent_total++;} + } +# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) +# {$G=''; $EG='';} + + if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} + $sessionid = trim($sessionid); + + $agentcount++; + $Aecho .= "| $G$extension$EG | $G$user$EG | $G$full_name$EG | $G$sessionid$EG LISTEN | BARGE | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; + + $i++; + } + + $Aecho .= "+------------|--------+-----------------+----------------+--------+--------+-----------------+-----------------+---------+------------+\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " NOTE: Click LISTEN to monitor agent call, you must have installed softphone on you machine.\n\n"; + + + $Aecho .= " - Paused agents\n"; + # $Aecho .= " - Balanced call\n"; + $Aecho .= " - Agent waiting for call\n"; + $Aecho .= " - Over 5 minutes on call\n"; + $Aecho .= " - Over 10 minutes on call\n"; + if ($agent_ready > 0) {$B=''; $BG='';} + if ($agent_ready > 4) {$B=''; $BG='';} + if ($agent_ready > 9) {$B=''; $BG='';} + if ($agent_ready > 14) {$B=''; $BG='';} + + + echo "\n
\n"; + + echo "$NFB$agent_total$NFE agents logged in         \n"; + + echo "$NFB$agent_incall$NFE agents in calls       \n"; + echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; + echo "$NFB$agent_paused$NFE paused agents       \n"; + + echo "
";
+		echo "";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo " NO AGENTS ON CALLS \n";
+	}
+
+?>
+
+ + diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/admin.php b/agc_2-X/trunk/LANG_www/vicidial_en/admin.php index 85bf7eae..9f9c02b6 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/admin.php @@ -274,6 +274,25 @@ if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} +if (isset($_GET["allcalls_delay"])) {$allcalls_delay=$_GET["allcalls_delay"];} + elseif (isset($_POST["allcalls_delay"])) {$allcalls_delay=$_POST["allcalls_delay"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} +if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} + elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} +if (isset($_GET["adaptive_dropped_percentage"])) {$adaptive_dropped_percentage=$_GET["adaptive_dropped_percentage"];} + elseif (isset($_POST["adaptive_dropped_percentage"])){$adaptive_dropped_percentage=$_POST["adaptive_dropped_percentage"];} +if (isset($_GET["available_only_ratio_tally"])) {$available_only_ratio_tally=$_GET["available_only_ratio_tally"];} + elseif (isset($_POST["available_only_ratio_tally"])){$available_only_ratio_tally=$_POST["available_only_ratio_tally"];} +if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} + elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} +if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$_GET["adaptive_latest_server_time"];} + elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} +if (isset($_GET["adaptive_intensity"])) {$adaptive_intensity=$_GET["adaptive_intensity"];} + elseif (isset($_POST["adaptive_intensity"])) {$adaptive_intensity=$_POST["adaptive_intensity"];} +if (isset($_GET["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_GET["adaptive_dl_diff_target"];} + elseif (isset($_POST["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_POST["adaptive_dl_diff_target"];} + if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -283,8 +302,6 @@ if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum ### DIGITS ONLY ### $user_level = ereg_replace("[^0-9]","",$user_level); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); @@ -344,6 +361,9 @@ $attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); $attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); $hotkey = ereg_replace("[^0-9]","",$hotkey); $list_id = ereg_replace("[^0-9]","",$list_id); +$allcalls_delay = ereg_replace("[^0-9]","",$allcalls_delay); +$adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage); +$adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -357,6 +377,8 @@ $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); $drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code); +$available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally); ### ALPHA-NUMERIC ONLY ### $user = ereg_replace("[^0-9a-zA-Z]","",$user); @@ -377,10 +399,15 @@ $scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); +$adaptive_maximum_level = ereg_replace("[^\.0-9]","",$adaptive_maximum_level); -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); +### ALPHA-NUMERIC and spaces and hash and star and comma +$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); +$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf); + +### ALPHACAPS-NUMERIC +$xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); +$xferconf_b_number = ereg_replace("[^0-9A-Z]","",$xferconf_b_number); ### ALPHA-NUMERIC and underscore and dash $dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); @@ -402,6 +429,7 @@ $group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); $user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); $OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); $state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); +$dial_method = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_method); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -424,6 +452,8 @@ $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comm $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); +$adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); +$adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); @@ -493,13 +523,23 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 60613-1415 - Added lead recycling options to campaign detail screen # 60619-1523 - Added variable filtering to eliminate SQL injection attack threat # 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug +# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug +# 60808-1147 - changed filtering for and added instructions for consutative transfers +# 60816-1552 - added allcalls_delay start delay for recordings in vicidial.php +# 60817-2226 - fixed bug that would not allow lead recycling of non-selectable statuses +# 60821-1543 - added option to Omit Phone Code while dialing in vicidial +# 60821-1625 - added ALLFORCE recording option for campaign_recording +# 60823-1154 - added fields for adaptive dialing +# 60824-1326 - added adaptive_latest_target_gmt for ADAPT_TAPERED dial method +# 60825-1205 - added adaptive_intensity for ADAPT_ dial methods +# 60828-1019 - changed adaptive_latest_target_gmt to adaptive_latest_server_time +# 60828-1115 - added adaptive_dl_diff_target and changed intensity dropdown # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$version = '1.1.12-3'; -$build = '60623-1159'; +$version = '2.0.65'; +$build = '60828-1115'; $STARTtime = date("U"); @@ -821,7 +861,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD= $NWB = "   \"HELP\""; +$NWE = "')\">\"HELP\""; ###################### # ADD=99999 display the HELP SCREENS ###################### @@ -1076,11 +1116,46 @@ echo "
Force Reset of Hopper - This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. +
+ +
+Dial Method - This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift(as defined by call_time selected for campaign) and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. +

Auto Dial Level - This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow. +
+
+
+Available Only Tally - This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N. + +
+
+
+Drop Percentage Limit - This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO. + +
+
+
+Maximum Adapt Dial Level - This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Auto Dial Level if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0. + +
+
+
+Latest Server Time - This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling. + +
+
+
+Adapt Intensity Modifier - This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods. + +
+
+
+Dial Level Difference Target - This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or RATIO dial methods. +

@@ -1105,6 +1180,11 @@ echo "
Dial Prefix - This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dialplan - extensions.conf. +
+ +
+Omit Phone Code - This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dialplan extensions.conf to place calls instead of 44 then 10 digits. Default is N. +

@@ -1123,13 +1203,18 @@ echo "

-Campaign Recording - This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. +Campaign Recording - This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load.

Campaign Rec Filename - This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. +
+
+
+Recording Delay - For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0. +

@@ -1153,7 +1238,7 @@ echo "

-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. +Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1300,7 +1385,7 @@ echo "\n";echo "\n";?> +echo "\n"; +?>

-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. +Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1734,8 +1819,8 @@ function openNewWindow(url) { \n"; -echo "
English Español
@@ -1965,7 +2050,7 @@ if (strlen($phone_number) > 2) echo "
ADD A NUMBER TO THE DNC LIST\n"; echo "\n"; echo "
  VICIDIAL ADMIN - Logout  
\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
\n"; @@ -2813,7 +2898,29 @@ if ($ADD==41) { echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -2928,7 +3035,29 @@ if ($ADD==44) { echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -4215,6 +4344,15 @@ echo "\n"; @@ -4290,7 +4432,58 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + + + +echo "\n"; + echo "\n"; @@ -4303,16 +4496,20 @@ echo "\n"; +echo "\n"; + echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; +echo "\n"; + echo "
\n"; $wrapup_message = $row[41]; # $closer_campaigns = $row[42]; $use_internal_dnc = $row[43]; + $allcalls_delay = $row[44]; + $omit_phone_code = $row[45]; + $dial_method = $row[46]; + $available_only_ratio_tally = $row[47]; + $adaptive_dropped_percentage = $row[48]; + $adaptive_maximum_level = $row[49]; + $adaptive_latest_server_time = $row[50]; + $adaptive_intensity = $row[51]; + $adaptive_dl_diff_target = $row[52]; echo "
MODIFY A CAMPAIGNS RECORD: $row[0] - Basic View"; echo " | Detail View | "; @@ -4237,28 +4375,32 @@ echo "
Dial status 1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' and selectable='Y' order by status"; + $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Hopper Level: Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Available Only Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Drop Percentage Limit: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Maximum Adapt Dial Level: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Latest Server Time: 4 digits only $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Dial Level Difference Target: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Dial Timeout: Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omit Phone Code: $NWB#vicidial_campaigns-omit_phone_code$NWE
Campaign CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Campaign VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Campaign Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Rec Filename: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Recording Delay: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: \n"; echo "\n"; echo "\n"; echo "Status:   \n"; echo "Attempt Delay: \n"; echo "Attempt Maximum: \n"; @@ -4612,6 +4809,8 @@ echo "\n"; @@ -4683,7 +4884,24 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_en/dbconnect.php index 1662f18f..7221b35e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/dbconnect.php @@ -1,15 +1,48 @@ LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; - -$WeBServeRRooT = '/usr/local/apache2/htdocs'; $WeBRooTWritablE = '1'; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/listloader.php b/agc_2-X/trunk/LANG_www/vicidial_en/listloader.php index 71dd25e4..6f5ec297 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/listloader.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/listloader.php @@ -11,12 +11,13 @@ # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60616-1006 - added listID override and gmt_offset lookup while loading # 60619-1652 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1105 - fixed for nonwritable directories # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # -$version = '1.1.12'; -$build = '60619-1652'; +$version = '2.0.1'; +$build = '60822-1105'; header ("Content-type: text/html; charset=utf-8"); @@ -52,7 +53,7 @@ $admDIR = "$HTTPprotocol$server_name$script_name"; $admDIR = eregi_replace('listloader.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   \"HELP\""; +$NWE = "')\">\"HELP\""; $secX = date("U"); @@ -142,8 +143,16 @@ function ShowProgress(good, bad, total) { if ($leadfile and filesize($LF_path)<=8388608) { print ""; flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "./vicidial_temp_file.txt"; + } + else + { + $lead_file = "$LF_path"; + } + $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} $pulldate=date("Y-m-d H:i:s"); @@ -157,7 +166,7 @@ if ($leadfile and filesize($LF_path)<=8388608) { if (count($field_check)>=5) { flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; @@ -199,7 +208,7 @@ if ($leadfile and filesize($LF_path)<=8388608) { $security_phrase = $row[21]; $comments = trim($row[22]); - if (strlen($phone_number)>8) + if (strlen($phone_number)>6) { $entry_date = "$pulldate"; $modify_date = ""; diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial_en/listloader.pl new file mode 100644 index 00000000..6c5a6dd0 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_en/listloader.pl @@ -0,0 +1,748 @@ +#!/usr/bin/perl + +### listloader.pl version 0.3 *DBI-version* +### +### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 +### +# +# +# CHANGES +# 60616-1548 - Added listID override feature to force all leads into same list +# - Added gmt_offset_now lookup for each lead +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# 60822-1121 - fixed for nonwritable directories +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) +{ + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help|-h/i) + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + } + else + { + if ($args =~ /--forcelistid=/i) + { + @data_in = split(/--forcelistid=/,$args); + $forcelistid = $data_in[1]; + $forcelistid =~ s/ .*//gi; + print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; + } + else + {$forcelistid = '';} + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} + } +} +### end parsing run-time options ### + + +use Spreadsheet::ParseExcel; +use Time::Local; +use DBI; + + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +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 =~ /^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_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +$|=0; +$secX = time(); + +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$year = ($year + 1900); +$mon++; +if ($hour < 10) {$hour = "0$hour";} +if ($min < 10) {$min = "0$min";} +if ($sec < 10) {$sec = "0$sec";} +if ($mon < 10) {$mon = "0$mon";} +if ($mday < 10) {$mday = "0$mday";} +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$pulldate="$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + + ### Grab Server values from the database + $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $DBSERVER_GMT = "$aryA[0]"; + if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + $rec_count++; + } + $sthA->finish(); + + $LOCAL_GMT_OFF = $SERVER_GMT; + $LOCAL_GMT_OFF_STD = $SERVER_GMT; + +if ($isdst) {$LOCAL_GMT_OFF++;} +if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + + +$total=0; $good=0; $bad=0; +print "
Processing Excel file...\n"; +open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); + +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); +my($iR, $iC, $oWkS, $oWkC); + +foreach $oWkS (@{$oBook->{Worksheet}}) { + for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { + + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user = ""; + $oWkC = $oWkS->{Cells}[$iR][0]; + if ($oWkC) {$vendor_lead_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][1]; + if ($oWkC) {$source_code=$oWkC->Value; } + $source_id=$source_code; + $oWkC = $oWkS->{Cells}[$iR][2]; + if ($oWkC) {$list_id=$oWkC->Value; } + $gmt_offset = '0'; + $called_since_last_reset='N'; + $oWkC = $oWkS->{Cells}[$iR][3]; + if ($oWkC) {$phone_code=$oWkC->Value; } + $phone_code=~s/[^0-9]//g; + $oWkC = $oWkS->{Cells}[$iR][4]; + if ($oWkC) {$phone_number=$oWkC->Value; } + $phone_number=~s/[^0-9]//g; + $USarea = substr($phone_number, 0, 3); + $oWkC = $oWkS->{Cells}[$iR][5]; + if ($oWkC) {$title=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][6]; + if ($oWkC) {$first_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][7]; + if ($oWkC) {$middle_initial=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][8]; + if ($oWkC) {$last_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][9]; + if ($oWkC) {$address1=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][10]; + if ($oWkC) {$address2=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][11]; + if ($oWkC) {$address3=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][12]; + if ($oWkC) {$city=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][13]; + if ($oWkC) {$state=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][14]; + if ($oWkC) {$province=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][15]; + if ($oWkC) {$postal_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][16]; + if ($oWkC) {$country=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][17]; + if ($oWkC) {$gender=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][18]; + if ($oWkC) {$date_of_birth=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][19]; + if ($oWkC) {$alt_phone=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][20]; + if ($oWkC) {$email=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][21]; + if ($oWkC) {$security_phrase=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][22]; + if ($oWkC) {$comments=$oWkC->Value; } + $comments=~s/^\s*(.*?)\s*$/$1/; + + if (length($phone_number)>6) { + if (length($forcelistid) > 0) + { + $list_id = $forcelistid; # set list_id to override value + } + + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =~ /^1$/) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### MEXICO ### + if ($phone_code =~ /^52$/) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### AUSTRALIA ### + if ($phone_code =~ /^61$/) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); + $year = ($year + 1900); + $mon++; + if ($mon < 10) {$mon = "0$mon";} + if ($mday < 10) {$mday = "0$mday";} + if ($hour < 10) {$hour = "0$hour";} + if ($min < 10) {$min = "0$min";} + if ($sec < 10) {$sec = "0$sec";} + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) + { + if ($DBX) {print " First Sunday April to Last Sunday October\n";} + &USA_dstcalc; + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) + { + if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + &GBR_dstcalc; + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) + { + if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + &AUS_dstcalc; + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) + { + if ($DBX) {print " First Sunday October to Last Sunday March\n";} + &AUST_dstcalc; + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) + { + if ($DBX) {print " First Sunday October to Third Sunday March\n";} + &NZL_dstcalc; + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print ""; + sleep(1); +# flush(); + } + } +} + +if ($multi_insert_counter > 0) { + $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; +} + +print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; + +exit; + + + + + + +sub USA_dstcalc { +#********************************************************************** +# FSA-LSO +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in April and last Sunday in October at 2 am. +# INPUTS: +# mm INTEGER Month. +# dd INTEGER Day of the month. +# ns INTEGER Seconds into the day. +# dow INTEGER Day of week (0=Sunday, to 6=Saturday) +# OPTIONAL INPUT: +# timezone INTEGER hour difference UTC - local standard time +# (DEFAULT is blank) +# make calculations based on UTC time, +# which means shift at 10:00 UTC in April +# and 9:00 UTC in October +# OUTPUT: +# INTEGER 1 = DST, 0 = not DST +#********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; return 0; + } elsif ($mm >= 5 && $mm <= 9) { + $USA_DST=1; return 1; + } elsif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $USA_DST=0; return 0; + } else { + $USA_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $USA_DST=0; return 0; + } else { + $USA_DST=1; return 1; + } + } + } else { + $USA_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $USA_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; return 1; + } else { + $USA_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 7200) { + $USA_DST=1; return 1; + } else { + $USA_DST=0; return 0; + } + } + } else { + $USA_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub GBR_dstcalc { +#********************************************************************** +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in March and last Sunday in October at 1 am. +#********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; return 0; + } elsif ($mm >= 4 && $mm <= 9) { + $GBR_DST=1; return 1; + } elsif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $GBR_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } + } else { + $GBR_DST=1; return 1; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $GBR_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } + } else { + $GBR_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub AUS_dstcalc { +#********************************************************************** +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUS_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUS_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } + } else { + $AUS_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $AUS_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } + } else { + $AUS_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub AUST_dstcalc { +#********************************************************************** +# TASMANIA ONLY +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUST_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUST_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } + } else { + $AUST_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } + } else { + $AUST_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub NZL_dstcalc { +#********************************************************************** +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and third Sunday in March at 1 am. +#********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $NZL_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; return 1; + } elsif ($dd < ($dow+14)) { + $NZL_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } + } else { + $NZL_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } + } else { + $NZL_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/listloaderMAIN.php b/agc_2-X/trunk/LANG_www/vicidial_en/listloaderMAIN.php index 67ee25bc..bb292c36 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/listloaderMAIN.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/listloaderMAIN.php @@ -8,6 +8,7 @@ # # changes: # 60620-1149 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1105 - fixed for nonwritable directories # require("dbconnect.php"); @@ -30,7 +31,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -59,13 +60,19 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } } } diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/listloader_rowdisplay.pl b/agc_2-X/trunk/LANG_www/vicidial_en/listloader_rowdisplay.pl new file mode 100644 index 00000000..fad44122 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_en/listloader_rowdisplay.pl @@ -0,0 +1,147 @@ +#!/usr/bin/perl + +### listloader_rowdisplay.pl version 0.2 *DBI-version* +### +### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 +### +# +# CHANGES +# +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) +{ + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help|-h/i) + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + } + else + { + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} + } +} +### end parsing run-time options ### + +use Spreadsheet::ParseExcel; +use Time::Local; +use DBI; + + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +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 =~ /^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_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); +my($iR, $iC, $oWkS, $oWkC); +$var_str=""; + +foreach $oWkS (@{$oBook->{Worksheet}}) { + for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { + $oWkC = $oWkS->{Cells}[0][$iC]; + if ($oWkC) { + $var_str.=$oWkC->Value."|"; + } else { + $var_str.="|"; + } + } +} + +@xls_row=split(/\|/, $var_str); + + +$stmtA = "select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + my $names = $sthA->{'NAME'}; + my $numFields = $sthA->{'NUM_OF_FIELDS'}; + for (my $i = 0; $i < $numFields; $i++) + { + # printf("%s%s", $i ? "," : "", $$names[$i]); + # printf("%s%s", $i ? "," : "", $$ref[$i]); + + $field_name=uc($$names[$i]); + $field_name=~s/\_/ /g; + print "
\r\n"; + print " \r\n"; + } + $rec_count++; + } +$sthA->finish(); + +exit; diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial_en/listloader_super.pl new file mode 100644 index 00000000..8e41bb39 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_en/listloader_super.pl @@ -0,0 +1,748 @@ +#!/usr/bin/perl + +### listloader_super.pl version 0.2 *DBI-version* +### +### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 +### +# +# +# CHANGES +# 60616-1548 - Added listID override feature to force all leads into same list +# - Added gmt_offset_now lookup for each lead +# 60811-1232 - Changed to DBI +# 60811-1329 - changed to use /etc/astguiclient.conf for configs +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) +{ + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help|-h/i) + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + } + else + { + if ($args =~ /--forcelistid=/i) + { + @data_in = split(/--forcelistid=/,$args); + $forcelistid = $data_in[1]; + $forcelistid =~ s/ .*//gi; + print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; + } + else + {$forcelistid = '';} + if ($args =~ /--lead-file=/i) + { + @data_in = split(/--lead-file=/,$args); + $lead_file = $data_in[1]; + $lead_file =~ s/ .*//gi; + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } + else + {$lead_file = './vicidial_temp_file.xls';} + } +} +### end parsing run-time options ### + +use Spreadsheet::ParseExcel; +use Time::Local; +use DBI; + + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +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 =~ /^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_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +$vars=$ARGV[0]; +@xls_fields=split(/\,/, $vars); + +$|=0; +$secX = time(); + +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$year = ($year + 1900); +$mon++; +if ($hour < 10) {$hour = "0$hour";} +if ($min < 10) {$min = "0$min";} +if ($sec < 10) {$sec = "0$sec";} +if ($mon < 10) {$mon = "0$mon";} +if ($mday < 10) {$mday = "0$mday";} +$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; +$pulldate="$year-$mon-$mday $hour:$min:$sec"; +$inSD = $pulldate0; +$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + + ### Grab Server values from the database + $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $DBSERVER_GMT = "$aryA[0]"; + if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + $rec_count++; + } + $sthA->finish(); + + $LOCAL_GMT_OFF = $SERVER_GMT; + $LOCAL_GMT_OFF_STD = $SERVER_GMT; + +if ($isdst) {$LOCAL_GMT_OFF++;} +if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} + + + +$total=0; $good=0; $bad=0; +open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); + +$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); +my($iR, $iC, $oWkS, $oWkC); + +foreach $oWkS (@{$oBook->{Worksheet}}) { + for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { + + $entry_date = "$pulldate"; + $modify_date = ""; + $status = "NEW"; + $user = ""; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[0]]; + if ($oWkC) {$vendor_lead_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[1]]; + if ($oWkC) {$source_code=$oWkC->Value; } + $source_id=$source_code; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[2]]; + if ($oWkC) {$list_id=$oWkC->Value; } + $gmt_offset = '0'; + $called_since_last_reset='N'; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[3]]; + if ($oWkC) {$phone_code=$oWkC->Value; } + $phone_code=~s/[^0-9]//g; + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[4]]; + if ($oWkC) {$phone_number=$oWkC->Value; } + $phone_number=~s/[^0-9]//g; + $USarea = substr($phone_number, 0, 3); + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[5]]; + if ($oWkC) {$title=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[6]]; + if ($oWkC) {$first_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[7]]; + if ($oWkC) {$middle_initial=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[8]]; + if ($oWkC) {$last_name=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[9]]; + if ($oWkC) {$address1=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[10]]; + if ($oWkC) {$address2=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[11]]; + if ($oWkC) {$address3=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[12]]; + if ($oWkC) {$city=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[13]]; + if ($oWkC) {$state=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[14]]; + if ($oWkC) {$province=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[15]]; + if ($oWkC) {$postal_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[16]]; + if ($oWkC) {$country_code=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[17]]; + if ($oWkC) {$gender=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[18]]; + if ($oWkC) {$date_of_birth=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[19]]; + if ($oWkC) {$alt_phone=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[20]]; + if ($oWkC) {$email=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[21]]; + if ($oWkC) {$security_phrase=$oWkC->Value; } + $oWkC = $oWkS->{Cells}[$iR][$xls_fields[22]]; + if ($oWkC) {$comments=$oWkC->Value; } + $comments=~s/^\s*(.*?)\s*$/$1/; + + if (length($phone_number)>6) { + if (length($forcelistid) > 0) + { + $list_id = $forcelistid; # set list_id to override value + } + + $PC_processed=0; + ### UNITED STATES ### + if ($phone_code =~ /^1$/) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### MEXICO ### + if ($phone_code =~ /^52$/) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### AUSTRALIA ### + if ($phone_code =~ /^61$/) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### ALL OTHER COUNTRY CODES ### + if (!$PC_processed) + { + $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); + $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); + $year = ($year + 1900); + $mon++; + if ($mon < 10) {$mon = "0$mon";} + if ($mday < 10) {$mday = "0$mday";} + if ($hour < 10) {$hour = "0$hour";} + if ($min < 10) {$min = "0$min";} + if ($sec < 10) {$sec = "0$sec";} + $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); + + $AC_processed=0; + if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) + { + if ($DBX) {print " First Sunday April to Last Sunday October\n";} + &USA_dstcalc; + if ($DBX) {print " DST: $USA_DST\n";} + if ($USA_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) + { + if ($DBX) {print " Last Sunday March to Last Sunday October\n";} + &GBR_dstcalc; + if ($DBX) {print " DST: $GBR_DST\n";} + if ($GBR_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) + { + if ($DBX) {print " Last Sunday October to Last Sunday March\n";} + &AUS_dstcalc; + if ($DBX) {print " DST: $AUS_DST\n";} + if ($AUS_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) + { + if ($DBX) {print " First Sunday October to Last Sunday March\n";} + &AUST_dstcalc; + if ($DBX) {print " DST: $AUST_DST\n";} + if ($AUST_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) + { + if ($DBX) {print " First Sunday October to Third Sunday March\n";} + &NZL_dstcalc; + if ($DBX) {print " DST: $NZL_DST\n";} + if ($NZL_DST) {$gmt_offset++;} + $AC_processed++; + } + if (!$AC_processed) + { + if ($DBX) {print " No DST Method Found\n";} + if ($DBX) {print " DST: 0\n";} + $AC_processed++; + } + + if ($multi_insert_counter > 8) { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; + $multistmt=''; + $multi_insert_counter=0; + + } else { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; + $multi_insert_counter++; + } + + $good++; + } else { + if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} + $bad++; + } + $total++; + if ($total%100==0) { + print ""; + sleep(1); +# flush(); + } + } +} + +if ($multi_insert_counter > 0) { + $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; + $affected_rows = $dbhA->do($stmtZ); + print STMT_FILE $stmtZ."\r\n"; +} + +print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; + +exit; + + + + + + +sub USA_dstcalc { +#********************************************************************** +# FSA-LSO +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in April and last Sunday in October at 2 am. +# INPUTS: +# mm INTEGER Month. +# dd INTEGER Day of the month. +# ns INTEGER Seconds into the day. +# dow INTEGER Day of week (0=Sunday, to 6=Saturday) +# OPTIONAL INPUT: +# timezone INTEGER hour difference UTC - local standard time +# (DEFAULT is blank) +# make calculations based on UTC time, +# which means shift at 10:00 UTC in April +# and 9:00 UTC in October +# OUTPUT: +# INTEGER 1 = DST, 0 = not DST +#********************************************************************** + + $USA_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 4 || $mm > 10) { + $USA_DST=0; return 0; + } elsif ($mm >= 5 && $mm <= 9) { + $USA_DST=1; return 1; + } elsif ($mm == 4) { + if ($dd > 7) { + $USA_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $USA_DST=0; return 0; + } else { + $USA_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 7200) { + $USA_DST=0; return 0; + } else { + $USA_DST=1; return 1; + } + } + } else { + $USA_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $USA_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $USA_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (7200+($timezone-1)*3600)) { + $USA_DST=1; return 1; + } else { + $USA_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 7200) { + $USA_DST=1; return 1; + } else { + $USA_DST=0; return 0; + } + } + } else { + $USA_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub GBR_dstcalc { +#********************************************************************** +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in March and last Sunday in October at 1 am. +#********************************************************************** + + $GBR_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $GBR_DST=0; return 0; + } elsif ($mm >= 4 && $mm <= 9) { + $GBR_DST=1; return 1; + } elsif ($mm == 3) { + if ($dd < 25) { + $GBR_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $GBR_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=0; return 0; + } else { + $GBR_DST=1; return 1; + } + } + } else { + $GBR_DST=1; return 1; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $GBR_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $GBR_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $GBR_DST=1; return 1; + } else { + $GBR_DST=0; return 0; + } + } + } else { + $GBR_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + +sub AUS_dstcalc { +#********************************************************************** +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on last Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUS_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUS_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUS_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUS_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUS_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=1; return 1; + } else { + $AUS_DST=0; return 0; + } + } + } else { + $AUS_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd < 25) { + $AUS_DST=0; return 0; + } elsif ($dd < ($dow+25)) { + $AUS_DST=0; return 0; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } else { # local time calculations + if ($ns < 3600) { + $AUS_DST=0; return 0; + } else { + $AUS_DST=1; return 1; + } + } + } else { + $AUS_DST=1; return 1; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub AUST_dstcalc { +#********************************************************************** +# TASMANIA ONLY +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and last Sunday in March at 1 am. +#********************************************************************** + + $AUST_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $AUST_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $AUST_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 25) { + $AUST_DST=1; return 1; + } elsif ($dd < ($dow+25)) { + $AUST_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $AUST_DST=1; return 1; + } else { + $AUST_DST=0; return 0; + } + } + } else { + $AUST_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd > 7) { + $AUST_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $AUST_DST=0; return 0; + } else { + $AUST_DST=1; return 1; + } + } + } else { + $AUST_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc + + + + + +sub NZL_dstcalc { +#********************************************************************** +# This is returns 1 if Daylight Savings Time is in effect and 0 if +# Standard time is in effect. +# Based on first Sunday in October and third Sunday in March at 1 am. +#********************************************************************** + + $NZL_DST=0; + $mm = $mon; + $dd = $mday; + $ns = $dsec; + $dow= $wday; + + if ($mm < 3 || $mm > 10) { + $NZL_DST=1; return 1; + } elsif ($mm >= 4 && $mm <= 9) { + $NZL_DST=0; return 0; + } elsif ($mm == 3) { + if ($dd < 14) { + $NZL_DST=1; return 1; + } elsif ($dd < ($dow+14)) { + $NZL_DST=1; return 1; + } elsif ($dow == 0) { + if ($timezone) { # UTC calculations + if ($ns < (3600+($timezone-1)*3600)) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } else { # local time calculations + if ($ns < 3600) { + $NZL_DST=1; return 1; + } else { + $NZL_DST=0; return 0; + } + } + } else { + $NZL_DST=0; return 0; + } + } elsif ($mm == 10) { + if ($dd > 7) { + $NZL_DST=1; return 1; + } elsif ($dd >= ($dow+1)) { + if ($timezone) { + if ($dow == 0 && $ns < (7200+$timezone*3600)) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } else { + if ($dow == 0 && $ns < 3600) { + $NZL_DST=0; return 0; + } else { + $NZL_DST=1; return 1; + } + } + } else { + $NZL_DST=0; return 0; + } + } # end of month checks +} # end of subroutine dstcalc diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_en/new_listloader_superL.php index d9471182..b5d149a2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_en/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_en/new_listloader_superL.php @@ -13,11 +13,12 @@ # 60616-1240 - added listID override # 60616-1604 - added gmt lookup for each lead # 60619-1651 - Added variable filtering to eliminate SQL injection attack threat +# 60822-1121 - fixed for nonwritable directories # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '1.1.12-1'; -$build = '60619-1651'; +$version = '2.0.1'; +$build = '60822-1121'; require("dbconnect.php"); @@ -94,6 +95,8 @@ if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"]; if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} $list_id_override = (preg_replace("/\D/","",$list_id_override)); +if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} + elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} @@ -114,7 +117,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; -$fp = fopen ("./project_auth_entries.txt", "a"); +if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); @@ -143,13 +146,19 @@ $browser = getenv("HTTP_USER_AGENT"); echo "You do not have permissions to load leads\n"; exit; } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); + fclose($fp); + } } else { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); + } } } @@ -163,7 +172,7 @@ $admDIR = "$HTTPprotocol$server_name$script_name"; $admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); $admSCR = 'admin.php'; $NWB = "   \"HELP\""; +$NWE = "')\">\"HELP\""; $secX = date("U"); $hour = date("H"); @@ -303,9 +312,11 @@ function ParseFileName() { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + { + $stmt_file=fopen("listloader_stmts.txt", "w"); + } $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); $pipe_count=substr_count($buffer, "|"); @@ -315,7 +326,7 @@ function ParseFileName() { if (count($field_check)>=5) { flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); print "
Processing $delim_name-delimited file...\n"; if (strlen($list_id_override)>0) @@ -364,7 +375,7 @@ function ParseFileName() { $security_phrase = $row[$security_phrase_field]; $comments = trim($row[$comments_field]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) @@ -416,19 +427,21 @@ function ParseFileName() { } } else if (!eregi(".csv", $leadfile_name)) { # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); + $file=fopen("$lead_file", "r"); print "
Processing Excel file... \n"; if (strlen($list_id_override)>0) { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); + # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead-file=$lead_file"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + $file=fopen("$lead_file", "r"); + + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} print "
Processing CSV file... \n"; if (strlen($list_id_override)>0) @@ -471,7 +484,7 @@ function ParseFileName() { $security_phrase = $row[$security_phrase_field]; $comments = trim($row[$comments_field]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) { @@ -528,9 +541,18 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "./vicidial_temp_file.txt"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); @@ -542,7 +564,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (count($field_check)>=5) { flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; if (strlen($list_id_override)>0) @@ -590,7 +612,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $security_phrase = $row[21]; $comments = trim($row[22]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) { @@ -640,15 +662,39 @@ if ($leadfile && filesize($LF_path)<=8388608) { } else { print "
ERROR: The file does not have the required number of fields to process it.
"; } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); + } else if (!eregi(".csv", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.xls"); + $lead_file = "/tmp/vicidial_temp_file.xls"; + } + $file=fopen("$lead_file", "r"); - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file"); + + } + else + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.csv"); + $lead_file = "/tmp/vicidial_temp_file.csv"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} print "
Processing CSV file... \n"; @@ -691,7 +737,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $security_phrase = $row[21]; $comments = trim($row[22]); - if (strlen($phone_number)>8) { + if (strlen($phone_number)>6) { if (strlen($list_id_override)>0) { @@ -752,10 +798,21 @@ if ($leadfile && filesize($LF_path)<=8388608) { $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.txt"); + $lead_file = "/tmp/vicidial_temp_file.txt"; + } + $file=fopen("$lead_file", "r"); + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -764,7 +821,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); + $file=fopen("$lead_file", "r"); print "
Processing $delim_name-delimited file...\n"; if (strlen($list_id_override)>0) @@ -826,13 +883,39 @@ if ($leadfile && filesize($LF_path)<=8388608) { #print " \r\n"; #print " \r\n"; } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); + } + else if (!eregi(".csv", $leadfile_name)) + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.xls"); + $lead_file = "/tmp/vicidial_temp_file.xls"; + } + + # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file"); + } + else + { + if ($WeBRooTWritablE > 0) + { + copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + } + else + { + copy($LF_path, "/tmp/vicidial_temp_file.csv"); + $lead_file = "/tmp/vicidial_temp_file.csv"; + } + $file=fopen("$lead_file", "r"); + + if ($WeBRooTWritablE > 0) + {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} print "
Processing CSV file... \n"; @@ -895,6 +978,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { } } print "
\r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print " \r\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_en/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial_en/vtiger_search.php new file mode 100644 index 00000000..6eaaf1bf --- /dev/null +++ b/agc_2-X/trunk/LANG_www/vicidial_en/vtiger_search.php @@ -0,0 +1,313 @@ + LICENSE: GPLv2 +### +# This page does a search against a standard vtiger CRM system. If the record +# is not present, it will create a new one and send the agent's screen to that new page. +# +# This code is tested against vtiger 4.2 +# +# CHANGES +# 60719-1615 - First version +# 60801-2304 - added mysql debug and auto-forward +# 60802-1111 - added insertion of not-found record into vtiger system +# + +#Asterisk/VICIDIAL Server (ASTERISK) +#Internal : 10.10.10.15 +#External : 55.55.55.55 + +#vtiger Server(TEST1) +#Internal : 10.10.10.16 +#External : 55.55.55.56 + + +### alter to connect to your vtiger database +$link=mysql_connect("10.10.10.16", "cron",'1234'); +if (!$link) {die('Could not connect: ' . mysql_error());} +echo 'Connected successfully'; +mysql_select_db("vtigercrm4_2"); + + +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["address1"])) {$address1=$_GET["address1"];} + elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} +if (isset($_GET["address2"])) {$address2=$_GET["address2"];} + elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} +if (isset($_GET["address3"])) {$address3=$_GET["address3"];} + elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} +if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} +if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} + elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["channel"])) {$channel=$_GET["channel"];} + elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} +if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} + elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} +if (isset($_GET["city"])) {$city=$_GET["city"];} + elseif (isset($_POST["city"])) {$city=$_POST["city"];} +if (isset($_GET["comments"])) {$comments=$_GET["comments"];} + elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} +if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} +if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} + elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} + elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} +if (isset($_GET["email"])) {$email=$_GET["email"];} + elseif (isset($_POST["email"])) {$email=$_POST["email"];} +if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} + elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} +if (isset($_GET["extension"])) {$extension=$_GET["extension"];} + elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} +if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} + elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} +if (isset($_GET["province"])) {$province=$_GET["province"];} + elseif (isset($_POST["province"])) {$province=$_POST["province"];} +if (isset($_GET["security"])) {$security=$_GET["security"];} + elseif (isset($_POST["security"])) {$security=$_POST["security"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["state"])) {$state=$_GET["state"];} + elseif (isset($_POST["state"])) {$state=$_POST["state"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} + elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +#$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +#$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +#$DB = '1'; # DEBUG override +$US = '_'; +$STARTtime = date("U"); +$TODAY = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$REC_TIME = date("Ymd-His"); +$FILE_datetime = $STARTtime; +$parked_time = $STARTtime; + +# $ext_context = 'default'; defined in dbconnect file + +# $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# $row=mysql_fetch_row($rslt); +# $auth=$row[0]; + +#$fp = fopen ("./project_auth_entries.txt", "a"); +#$date = date("r"); +#$ip = getenv("REMOTE_ADDR"); +#$browser = getenv("HTTP_USER_AGENT"); + +# if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) +# { +# Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); +# Header("HTTP/1.0 401 Unauthorized"); +# echo "Invalid Username/Password: |$user|$pass|\n"; +# exit; +# } +# else +# { +# +# if($auth>0) +# { +# $office_no=strtoupper($user); +# $password=strtoupper($pass); +# $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# $row=mysql_fetch_row($rslt); +# $LOGfullname=$row[0]; +# $fullname = $row[0]; +# fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); +# fclose($fp); +# +# if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) ) +# { +# echo "\n\n"; +# echo "\n\n"; +# +# } +# else +# { +# echo "Bad channel: $customer_zap_channel\n"; +# echo "Make sure the Zap channel is live and try again\n"; +# exit; +# } +# +# } +# else +# { +# fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); +# fclose($fp); +# } +# } + +echo "\n"; +echo "\n"; +echo "VICIDIAL Vtiger Lookup\n"; +echo "\n"; + + +$stmt="SELECT count(*) from account where phone='$phone' or otherphone='$phone' or fax='$phone';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +if (!$rslt) { + die('Could not execute: ' . mysql_error()); +} +$row=mysql_fetch_row($rslt); +$found_count = $row[0]; + +#echo "
\n|$phone|$found_count|\n"; + +if ($found_count < 1) +{ + echo "\n"; + echo "\n"; + echo "
\n"; + echo "$phone not found, creating account...\n"; + + if ($DB) {echo "
";}
+	$stmt="SELECT id from users where user_name='$user';";
+	if ($DB) {echo "$stmt\n";}
+	$rslt=mysql_query($stmt, $link);
+	$row=mysql_fetch_row($rslt);
+	$user_id = $row[0];
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO crmentity (smcreatorid, smownerid, modifiedby, setype, description, createdtime, modifiedtime, viewedtime, status, version, presence, deleted) VALUES ('$user_id', '$user_id', 0, 'Accounts', NULL, '$NOW_TIME', '$NOW_TIME', '$NOW_TIME', NULL, 0, 1, 1);";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	$recordID = mysql_insert_id($link);
+	if ($DB) {echo "|$recordID|\n";}
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+#	$stmt = "INSERT INTO accountscf (accountid, cf_393, cf_397, cf_403, cf_405, cf_407, cf_409, cf_411) VALUES ('$recordID', NULL, NULL, NULL, NULL, NULL, NULL, NULL);";
+#	if ($DB) {echo "|$stmt|\n";}
+#	$rslt=mysql_query($stmt, $link);
+#	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO account (accountid,accountname,contactname,phone,otherphone,email1) values('$recordID','$last_name, $first_name','$first_name $last_name','$phone','$alt_phone','$email');";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO accountbillads (accountaddressid,city,code,country,state,street) values('$recordID','$city','$postal_code','US','$state','$address1');";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	$stmt = "INSERT INTO accountshipads (accountaddressid,city,code,country,state,street) values('$recordID','$city','$postal_code','US','$state','$address1');";
+	if ($DB) {echo "|$stmt|\n";}
+	$rslt=mysql_query($stmt, $link);
+	if (!$rslt) {die('Could not execute: ' . mysql_error());}
+
+	if ($DB) {echo "DONE\n";}
+
+	$account_URL = "http://55.55.55.56/index.php?module=Accounts&action=DetailView&record=$recordID";
+	echo "\n";
+	echo "\n";
+	echo "\n";
+	echo "
\n"; + + echo "
";
+	echo "account created!\n";
+	echo "accountid:   $recordID\n";
+	echo "phone:       $phone\n";
+	echo "

"; + +} +else +{ + $stmt="SELECT accountid,accountname,contactname from account where phone='$phone' or otherphone='$phone' or fax='$phone';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $accountid = $row[0]; + $accountname = $row[1]; + $contactname = $row[2]; + + $account_URL = "http://55.55.55.56/index.php?module=Accounts&action=DetailView&record=$accountid"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "
";
+	echo "account found!\n";
+	echo "accountid:   $accountid\n";
+	echo "phone:       $phone\n";
+	echo "accountname: $accountname\n";
+	echo "contactname: $contactname\n";
+	echo "

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


\n\n"; + + +echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; + + +?> + + + + + + + + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDAD_closer.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDAD_closer.php index 9850f4ed..c399ae3c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDAD_closer.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDAD_closer.php @@ -173,7 +173,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $ext_count) { - $stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; + $stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $camp_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php index 428c8d56..27c01b59 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php @@ -13,6 +13,7 @@ # 60608-1539 - Fixed CLOSER tallies for active calls # 60619-1658 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 60626-1453 - Added display of system load to bottom (Angelito Manansala) # header ("Content-type: text/html; charset=utf-8"); @@ -39,6 +40,46 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} if (!isset($group)) {$group='';} +function get_server_load($windows = false) { +$os = strtolower(PHP_OS); +if(strpos($os, "win") === false) { +if(file_exists("/proc/loadavg")) { +$load = file_get_contents("/proc/loadavg"); +$load = explode(' ', $load); +return $load[0]; +} +elseif(function_exists("shell_exec")) { +$load = explode(' ', `uptime`); +return $load[count($load)-1]; +} +else { +return false; +} +} +elseif($windows) { +if(class_exists("COM")) { +$wmi = new COM("WinMgmts:\\\\."); +$cpus = $wmi->InstancesOf("Win32_Processor"); + +$cpuload = 0; +$i = 0; +while ($cpu = $cpus->Next()) { +$cpuload += $cpu->LoadPercentage; +$i++; +} + +$cpuload = round($cpuload / $i, 2); +return "$cpuload%"; +} +else { +return false; +} +} +} + +$load_ave = get_server_load(true); + + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -139,10 +180,11 @@ echo "\n\n"; if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} else { -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $HOPlev = $row[8]; +$DIALmethod = $row[9]; echo "
\n"; $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $display_dialable_count = $row[39]; + $dial_method = $row[46]; + $adaptive_intensity = $row[51]; echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Basic View | "; echo "Detail View | "; @@ -4634,24 +4833,26 @@ echo "
Dial status 1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Hopper Level: Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id
".$field_name.": \r\n"; + print " \r\n"; + print "
        
"; echo ""; @@ -156,13 +198,21 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct,differential_onemin,agents_average_onemin from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $DAleads = $row[0]; $callsTODAY = $row[1]; $dropsTODAY = $row[2]; $drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; +$agentsONEMIN = $row[5]; +if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) + { + $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); + $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); + } +else {$diffpctONEMIN = '0.00';} echo ""; echo ""; @@ -175,6 +225,13 @@ echo ""; echo ""; echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + echo "
DIAL LEVEL:  $row[0]   
HOPPER LEVEL:  $HOPlev     CALLS TODAY:CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
DIAL METHOD:  $DIALmethod     DL DIFF:  $diffONEMIN     AVG AGENTS:  $agentsONEMIN     DIFF:  $diffpctONEMIN%    
"; @@ -295,7 +352,7 @@ $talking_to_print = mysql_num_rows($rslt); # if ($call_time_M_int >= 10) {$G=''; $EG='';} if (eregi("PAUSED",$row[3])) { - if ($call_time_M_int >= 1) + if ($call_time_M_int >= 5) {$i++; continue;} else {$G=''; $EG=''; $agent_paused++; $agent_total++;} @@ -314,7 +371,8 @@ $talking_to_print = mysql_num_rows($rslt); } $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " System Load Average: $load_ave\n\n"; $Aecho .= " - Agentes detenidos brevemente\n"; # $Aecho .= " - Balanced call\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall_SIPmonitor.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall_SIPmonitor.php index 27281fb1..6b5057ea 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall_SIPmonitor.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall_SIPmonitor.php @@ -1,301 +1,326 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$ENVIAR=$_GET["ENVIAR"]; if (!$ENVIAR) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Campaña: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Campaña: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFICAR | INFORMES \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo "LLAMADAS EN ESPERA\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Campaña: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVIDOR IP | CALL SERVIDOR IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Agentes detenidos brevemente\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo "AGENTES SIN LLAMADAS\n";
-	}
-
-?>
-
- - - - - - - + LICENSE: GPLv2 +### Contributions by Magma Networks LLC +### +# live real-time stats for the VICIDIAL Auto-Dialer all servers +# +# changes: +# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) +# 51130-1218 - Modified layout and info to show all servers in a vicidial system +# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala +# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat +# - Added required user/pass to gain access to this page +# - Added 10 minutes on call (Magma Networks LLC) +# - Added extended pause (exceeding 60 seconds -> 20 minutes) (Magma Networks LLC) +# - Added Full Name Field to extract from Database (Magma Networks LLC) +# - Added Barge Link (Magma Networks LLC) +header ("Content-type: text/html; charset=utf-8"); + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} +$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} +$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} +$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} +$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} +$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} +$ENVIAR=$_GET["ENVIAR"]; if (!$ENVIAR) {$ENVIAR=$_POST["ENVIAR"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $auth=$row[0]; + + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +$epochSIXhoursAGO = ($STARTtime - 21600); +$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); + +$stmt="select campaign_id from vicidial_campaigns;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $groups_to_print) + { + $row=mysql_fetch_row($rslt); + $groups[$i] =$row[0]; + $i++; + } + +if (!$RR) {$RR=40;} + +$NFB = ''; +$NFE = ''; +$F=''; $FG=''; $B=''; $BG=''; +$reset_counter++; + +if ($reset_counter > 7) + { + $reset_counter=0; + } + +?> + + + + + +\n"; +echo"\n"; +echo "VF DIALER: Time On VDAD Campaña: $group\n"; +echo "
\n"; +echo "VF DIALER: Realtime Campaña: \n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "         \n"; +echo "STOP | GO"; +echo "         MODIFICAR | INFORMES \n"; +echo "\n\n"; + +if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} +else +{ +$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); + +echo "
"; +echo "DIAL LEVEL: $row[0]         "; +echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; +echo "ORDER: $row[6]"; +echo "\n\n"; +} +################################################################################### +###### OUTBOUND CALLS +################################################################################### +if (eregi("CLOSER",$group)) + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} +else + {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$parked_to_print = mysql_num_rows($rslt); + if ($parked_to_print > 0) + { + $i=0; + $out_total=0; + $out_ring=0; + $out_live=0; + while ($i < $parked_to_print) + { + $row=mysql_fetch_row($rslt); + + if (eregi("LIVE",$row[0])) + {$out_live++;} + else + { + if (eregi("CLOSER",$row[0])) + {$nothing=1;} + else + {$out_ring++;} + } + $out_total++; + $i++; + } + + if ($out_live > 0) {$F=''; $FG='';} + if ($out_live > 4) {$F=''; $FG='';} + if ($out_live > 9) {$F=''; $FG='';} + if ($out_live > 14) {$F=''; $FG='';} + + if (eregi("CLOSER",$group)) + {echo "$NFB$out_total$NFE current active calls      \n";} + else + {echo "$NFB$out_total$NFE calls being placed       \n";} + + echo "$NFB$out_ring$NFE calls ringing         \n"; + echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; + } + else + { + echo "LLAMADAS EN ESPERA\n"; + } + + +################################################################################### +###### TIME ON SYSTEM +################################################################################### + +$agent_incall=0; +$agent_ready=0; +$agent_paused=0; +$agent_total=0; + +$Aecho = ''; +$Aecho .= "VF DIALER: Agents Time On Calls Campaña: $group $NOW_TIME\n\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; +$Aecho .= "| STATION | USER | FULL NAME | SESSIONID | BARGE | STATUS | SERVIDOR IP | CALL SERVIDOR IP | MM:SS | CAMPAIGN |\n"; +$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; + + +$stmt=" + select + extension, + vicidial_live_agents.user, + conf_exten, + status, + server_ip, + UNIX_TIMESTAMP(last_call_time), + UNIX_TIMESTAMP(last_call_finish), + call_server_ip, + campaign_id, + vicidial_users.full_name as full_name + from vicidial_live_agents + left join vicidial_users on vicidial_live_agents.user = vicidial_users.user + where + campaign_id='" . mysql_real_escape_string($group) . "' + order by + status, + last_call_time; +"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$talking_to_print = mysql_num_rows($rslt); + if ($talking_to_print > 0) + { + $i=0; + $agentcount=0; + while ($i < $talking_to_print) + { + $row=mysql_fetch_row($rslt); + if (eregi("READY|PAUSED",$row[4])) + { + $row[5]=$row[6]; + } + $extension = sprintf("%-10s", $row[0]); + $user = sprintf("%-6s", $row[1]); + $sessionid = sprintf("%-9s", $row[2]); + $status = sprintf("%-6s", $row[3]); + $server_ip = sprintf("%-15s", $row[4]); + $call_server_ip = sprintf("%-15s", $row[7]); + $campaign_id = sprintf("%-10s", $row[8]); + $full_name = sprintf("%-15s", $row[9]); + while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);} + $call_time_S = ($STARTtime - $row[5]); + + $call_time_M = ($call_time_S / 60); + $call_time_M = round($call_time_M, 2); + $call_time_M_int = intval("$call_time_M"); + $call_time_SEC = ($call_time_M - $call_time_M_int); + $call_time_SEC = ($call_time_SEC * 60); + $call_time_SEC = round($call_time_SEC, 0); + if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} + $call_time_MS = "$call_time_M_int:$call_time_SEC"; + $call_time_MS = sprintf("%7s", $call_time_MS); + $G = ''; $EG = ''; + if ($call_time_M_int >= 5) {$G=''; $EG='';} +# if ($call_time_M_int >= 10) {$G=''; $EG='';} + if (eregi("PAUSED",$row[3])) + { + if ($call_time_M_int >= 20) + {$i++; continue;} + else + {$G=''; $EG=''; $agent_paused++; $agent_total++;} + } +# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) +# {$G=''; $EG='';} + + if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} + if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} + $sessionid = trim($sessionid); + + $agentcount++; + $Aecho .= "| $G$extension$EG | $G$user$EG | $G$full_name$EG | $G$sessionid$EG LISTEN | BARGE | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; + + $i++; + } + + $Aecho .= "+------------|--------+-----------------+----------------+--------+--------+-----------------+-----------------+---------+------------+\n"; + $Aecho .= " $agentcount agents logged in on all servers\n"; + $Aecho .= " NOTE: Click LISTEN to monitor agent call, you must have installed softphone on you machine.\n\n"; + + + $Aecho .= " - Agentes detenidos brevemente\n"; + # $Aecho .= " - Balanced call\n"; + $Aecho .= " - Agent waiting for call\n"; + $Aecho .= " - Over 5 minutes on call\n"; + $Aecho .= " - Sobre 10 minutos en llamada\n"; + if ($agent_ready > 0) {$B=''; $BG='';} + if ($agent_ready > 4) {$B=''; $BG='';} + if ($agent_ready > 9) {$B=''; $BG='';} + if ($agent_ready > 14) {$B=''; $BG='';} + + + echo "\n
\n"; + + echo "$NFB$agent_total$NFE agents logged in         \n"; + + echo "$NFB$agent_incall$NFE agents in calls       \n"; + echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; + echo "$NFB$agent_paused$NFE paused agents       \n"; + + echo "
";
+		echo "";
+		echo "$Aecho";
+	}
+	else
+	{
+	echo "AGENTES SIN LLAMADAS\n";
+	}
+
+?>
+
+ + + + + + + diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin.php index 558e011c..76a8c361 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin.php @@ -274,6 +274,25 @@ if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} +if (isset($_GET["allcalls_delay"])) {$allcalls_delay=$_GET["allcalls_delay"];} + elseif (isset($_POST["allcalls_delay"])) {$allcalls_delay=$_POST["allcalls_delay"];} +if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} + elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} +if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} + elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} +if (isset($_GET["adaptive_dropped_percentage"])) {$adaptive_dropped_percentage=$_GET["adaptive_dropped_percentage"];} + elseif (isset($_POST["adaptive_dropped_percentage"])){$adaptive_dropped_percentage=$_POST["adaptive_dropped_percentage"];} +if (isset($_GET["available_only_ratio_tally"])) {$available_only_ratio_tally=$_GET["available_only_ratio_tally"];} + elseif (isset($_POST["available_only_ratio_tally"])){$available_only_ratio_tally=$_POST["available_only_ratio_tally"];} +if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} + elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} +if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$_GET["adaptive_latest_server_time"];} + elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} +if (isset($_GET["adaptive_intensity"])) {$adaptive_intensity=$_GET["adaptive_intensity"];} + elseif (isset($_POST["adaptive_intensity"])) {$adaptive_intensity=$_POST["adaptive_intensity"];} +if (isset($_GET["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_GET["adaptive_dl_diff_target"];} + elseif (isset($_POST["adaptive_dl_diff_target"])) {$adaptive_dl_diff_target=$_POST["adaptive_dl_diff_target"];} + if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -283,8 +302,6 @@ if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum ### DIGITS ONLY ### $user_level = ereg_replace("[^0-9]","",$user_level); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); $drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); @@ -344,6 +361,9 @@ $attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); $attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); $hotkey = ereg_replace("[^0-9]","",$hotkey); $list_id = ereg_replace("[^0-9]","",$list_id); +$allcalls_delay = ereg_replace("[^0-9]","",$allcalls_delay); +$adaptive_dropped_percentage = ereg_replace("[^0-9]","",$adaptive_dropped_percentage); +$adaptive_latest_server_time = ereg_replace("[^0-9]","",$adaptive_latest_server_time); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -357,6 +377,8 @@ $reset_list = ereg_replace("[^NY]","",$reset_list); $fronter_display = ereg_replace("[^NY]","",$fronter_display); $drop_message = ereg_replace("[^NY]","",$drop_message); $use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); +$omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code); +$available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally); ### ALPHA-NUMERIC ONLY ### $user = ereg_replace("[^0-9a-zA-Z]","",$user); @@ -377,10 +399,15 @@ $scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); $auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); +$adaptive_maximum_level = ereg_replace("[^\.0-9]","",$adaptive_maximum_level); -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); +### ALPHA-NUMERIC and spaces and hash and star and comma +$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); +$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf); + +### ALPHACAPS-NUMERIC +$xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); +$xferconf_b_number = ereg_replace("[^0-9A-Z]","",$xferconf_b_number); ### ALPHA-NUMERIC and underscore and dash $dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); @@ -402,6 +429,7 @@ $group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); $user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); $OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); $state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); +$dial_method = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_method); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -424,6 +452,8 @@ $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comm $campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); +$adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); +$adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); @@ -493,13 +523,23 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 60613-1415 - Added lead recycling options to campaign detail screen # 60619-1523 - Added variable filtering to eliminate SQL injection attack threat # 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug +# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug +# 60808-1147 - changed filtering for and added instructions for consutative transfers +# 60816-1552 - added allcalls_delay start delay for recordings in vicidial.php +# 60817-2226 - fixed bug that would not allow lead recycling of non-selectable statuses +# 60821-1543 - added option to Omit Phone Code while dialing in vicidial +# 60821-1625 - added ALLFORCE recording option for campaign_recording +# 60823-1154 - added fields for adaptive dialing +# 60824-1326 - added adaptive_latest_target_gmt for ADAPT_TAPERED dial method +# 60825-1205 - added adaptive_intensity for ADAPT_ dial methods +# 60828-1019 - changed adaptive_latest_target_gmt to adaptive_latest_server_time +# 60828-1115 - added adaptive_dl_diff_target and changed intensity dropdown # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$version = '1.1.12-3'; -$build = '60623-1159'; +$version = '2.0.65'; +$build = '60828-1115'; $STARTtime = date("U"); @@ -1076,11 +1116,46 @@ echo "
Reajuste de la fuerza de la tolva - esto permite que usted limpie fuera del contenido de la tolva sobre la sumisión de la forma. Debe ser llenada otra vez cuando la escritura de VDhopper funciona. +
+ +
+Dial Method - This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift(as defined by call_time selected for campaign) and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. +

Nivel auto del dial - aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automóvil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. +
+
+
+Available Only Tally - This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N. + +
+
+
+Drop Percentage Limit - This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO. + +
+
+
+Maximum Adapt Dial Level - This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Nivel del Auto-Dial if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0. + +
+
+
+Latest Server Time - This field is only used by the ADAPT_TAPERED dial method. You should enter in the hour and minute that you will stop calling on this campaign, 2100 would mean that you will stop dialing this campaign at 9PM server time. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling. + +
+
+
+Adapt Intensity Modifier - This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods. + +
+
+
+Dial Level Difference Target - This field is used to define whether you want to target having a specific number of agents waiting for calls or calls waiting for agents. For example if you would always like to have on average one agent free to take calls immediately you would set this to -1, if you would like to target always having one call on hold waiting for an agent you would set this to 1. Default is 0. This field is not used by the MANUAL or RATIO dial methods. +

@@ -1105,6 +1180,11 @@ echo "
Prefijo del dial - este campo permite más fácilmente cambiar una trayectoria de marcar a salir con un diverso método sin hacer una recarga en asterisco. El defecto es 9 basados sobre un 91NXXNXXXXXX en el dialplan - extensions.conf. +
+ +
+Omit Phone Code - This field allows you to leave out the phone_code field while dialing within VICIDIAL. For instance if you are dialing in the UK from the UK you would have 44 in as your phone_code field for all leads, but you just want to dial 10 digits in your dialplan extensions.conf to place calls instead of 44 then 10 digits. Default is N. +

@@ -1123,13 +1203,18 @@ echo "

-Grabación de la campaña - este menú permite que usted elija qué nivel de la grabación se permite en esta campaña. NEVER inhabilitará la grabación en el cliente. ONDEMAND es el defecto y permite que el agente comience y pare a registrar según lo necesitado. ALLCALLS comenzará la grabación en el cliente siempre que una llamada se envíe a un agente. +Grabación de la campaña - este menú permite que usted elija qué nivel de la grabación se permite en esta campaña. NEVER inhabilitará la grabación en el cliente. ONDEMAND es el defecto y permite que el agente comience y pare a registrar según lo necesitado. ALLCALLS comenzará la grabación en el cliente siempre que una llamada se envíe a un agente. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load.

Nombre de fichero de Rec de la campaña - este campo permite que usted modifique el nombre para requisitos particulares de la grabación cuando la grabación de la campaña es ONDEMAND o ALLCALLS. Las variables permitidas son CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. El defecto es FULLDATE_AGENTE y parecería este 20051020-103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que parecería este TESTCAMP_51020103108_3125551212. 50 char max. +
+
+
+Recording Delay - For ALLCALLS and ALLFORCE recording only. This setting will delay the starting of the recording on all calls for the number of seconds specified in this field. Default is 0. +

@@ -1153,7 +1238,7 @@ echo "

-Xfer-Conf DTMF - Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo'vil-poblara' el nu'mero-a-dial y los campos del enviar-dtmf cuando está presionada. +Xfer-Conf DTMF - Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo'vil-poblara' el nu'mero-a-dial y los campos del enviar-dtmf cuando está presionada. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1300,7 +1385,7 @@ echo "

-Xfer-Conf DTMF - Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo'vil-poblara' el nu'mero-a-dial y los campos del enviar-dtmf cuando está presionada. +Xfer-Conf DTMF - Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo'vil-poblara' el nu'mero-a-dial y los campos del enviar-dtmf cuando está presionada. If you want to allow Consultative Transfers, a fronter to a closer, you can place CXFER as one of the number-to-dial presets and the proper dialstring will be sent to do a Local Consultative Transfer, then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to a VICIDIAL AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify an custom extension after the AXFER or CXFER, for instance if you want to do Internal Consultative transfers instead of Local you would put CXFER90009 in the number-to-dial field.
@@ -1965,7 +2050,7 @@ if (strlen($phone_number) > 2) echo "
AGREGUE Un NÚMERO A la LISTA De DNC
\n"; echo "\n"; echo "
\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Número De Teléfono: (Solamente dígitos)$NWB#vicidial_list-dnc$NWE
Número De Teléfono: (Solamente dígitos)$NWB#vicidial_list-dnc$NWE
\n"; @@ -2813,7 +2898,29 @@ if ($ADD==41) { echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -2928,7 +3035,29 @@ if ($ADD==44) { echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; + if ($dial_method == 'RATIO') + { + if ($auto_dial_level < 1) {$auto_dial_level = "1.0";} + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + else + { + if ($dial_method == 'MANUAL') + { + $auto_dial_level='0'; + $adlSQL = "auto_dial_level='0',"; + } + else + { + $adlSQL = ""; + if ($auto_dial_level < 1) + { + $auto_dial_level = "1.0"; + $adlSQL = "auto_dial_level='$auto_dial_level',"; + } + } + } + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -4215,6 +4344,15 @@ echo "\n"; @@ -4290,7 +4432,58 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + +echo "\n"; + + + +echo "\n"; + echo "\n"; @@ -4303,16 +4496,20 @@ echo "\n"; +echo "\n"; + echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; +echo "\n"; + echo "
\n"; $wrapup_message = $row[41]; # $closer_campaigns = $row[42]; $use_internal_dnc = $row[43]; + $allcalls_delay = $row[44]; + $omit_phone_code = $row[45]; + $dial_method = $row[46]; + $available_only_ratio_tally = $row[47]; + $adaptive_dropped_percentage = $row[48]; + $adaptive_maximum_level = $row[49]; + $adaptive_latest_server_time = $row[50]; + $adaptive_intensity = $row[51]; + $adaptive_dl_diff_target = $row[52]; echo "
MODIFIQUE Un EXPEDIENTE De las CAMPAÚAS: $row[0] - Vista Básica"; echo " | Vista Detallada | "; @@ -4237,28 +4375,32 @@ echo "
Estado del dial 1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' and selectable='Y' order by status"; + $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; + $LRstatuses_list .= "\n"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Nivel Del Hopper: echo "
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Available Only Tally: $NWB#vicidial_campaigns-available_only_ratio_tally$NWE
Drop Percentage Limit: % $NWB#vicidial_campaigns-adaptive_dropped_percentage$NWE
Maximum Adapt Dial Level: number only $NWB#vicidial_campaigns-adaptive_maximum_level$NWE
Latest Server Time: 4 Solamente dígitos $NWB#vicidial_campaigns-adaptive_latest_server_time$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Dial Level Difference Target: $NWB#vicidial_campaigns-adaptive_dl_diff_target$NWE
Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
Tiempo de espera Del Dial: Prefijo al marcar: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Omit Phone Code: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID de la Campaña: $NWB#vicidial_campaigns-campaign_cid$NWE
Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Extensión de Rec de la campaña: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Grabación De la Campaña: $NWB#vicidial_campaigns-campaign_recording$NWE
Grabación De la Campaña: $NWB#vicidial_campaigns-campaign_recording$NWE
Nombre de fichero De Rec De la Campaña: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Recording Delay: in seconds$NWB#vicidial_campaigns-allcalls_delay$NWE
Script: \n"; echo "\n"; echo "\n"; echo "Estado:   \n"; echo "La Tentativa Retrasa: \n"; echo "Máximo De la Tentativa: \n"; @@ -4612,6 +4809,8 @@ echo "\n"; @@ -4683,7 +4884,24 @@ echo "\n"; -echo "\n"; +echo "\n"; + +echo "\n"; + +echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php index 1662f18f..7221b35e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php @@ -1,15 +1,48 @@ LICENSE: GPLv2 +# +if ( file_exists("/etc/astguiclient.conf") ) +{ +$DBCagc = file("/etc/astguiclient.conf"); +foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); +} +else +{ +#defaults for DB connection +$VARDB_server = 'localhost'; +$VARDB_user = 'cron'; +$VARDB_pass = '1234'; +$VARDB_database = '1234'; +$WeBServeRRooT = '/usr/local/apache2/htdocs'; +} + +$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); +mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; $conf_silent_prefix = '7'; $local_AMP = '@'; $ext_context = 'demo'; $recording_exten = '8309'; - -$WeBServeRRooT = '/usr/local/apache2/htdocs'; $WeBRooTWritablE = '1'; ?> diff --git a/agc_2-X/trunk/translations/pl_language.txt b/agc_2-X/trunk/translations/pl_language.txt index 90bc3bef..09313763 100644 --- a/agc_2-X/trunk/translations/pl_language.txt +++ b/agc_2-X/trunk/translations/pl_language.txt @@ -336,8 +336,8 @@ PARK|PARKING| IN-NUMBER|IN-NUMBER| NUMBER|NUMER| LENGTH|DŁUGOŚĆ| -CALLERID|ID-ROZMÓWCY| -CallerID|ID-Rozmówcy| +CALLERID|IDROZMÓWCY| +CallerID|IDRozmówcy| CALL| Rozmowa| PICKUP|ODBIERZ| CONFERENCE|KONFERENCJA| diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 3cd8df82..eeae3178 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -169,8 +169,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '2.0.96'; -$build = '60821-1643'; +$version = '2.0.97'; +$build = '60829-1531'; if ($force_logout) {
\n"; $lead_filter_id = $row[35]; if ($lead_filter_id=='') {$lead_filter_id='NONE';} $display_dialable_count = $row[39]; + $dial_method = $row[46]; + $adaptive_intensity = $row[51]; echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Vista Básica | "; echo "Vista Detallada | "; @@ -4634,24 +4833,26 @@ echo "
Estado del dial 1: $o) { + while ($statuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $Cstatuses_to_print = mysql_num_rows($rslt); $o=0; - while ($Cstatuses_to_print > $o) { + while ($Cstatuses_to_print > $o) + { $rowx=mysql_fetch_row($rslt); $statuses_list .= "\n"; $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; - } + } echo "$statuses_list"; echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE
Nivel Del Hopper: echo "
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Dial Method: $NWB#vicidial_campaigns-dial_method$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Adapt Intensity Modifier: $NWB#vicidial_campaigns-adaptive_intensity$NWE
Script: $script_id