diff --git a/agc_2-X/trunk/LANG_www/agc_es/active_list_refresh.php b/agc_2-X/trunk/LANG_www/agc_es/active_list_refresh.php index 6813fdd1..fb94a573 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/active_list_refresh.php +++ b/agc_2-X/trunk/LANG_www/agc_es/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_es/call_log_display.php b/agc_2-X/trunk/LANG_www/agc_es/call_log_display.php index f6c36dff..cc48a77b 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/call_log_display.php +++ b/agc_2-X/trunk/LANG_www/agc_es/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_es/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php index 08a640e3..243101df 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_es/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_es/inbound_popup.php b/agc_2-X/trunk/LANG_www/agc_es/inbound_popup.php index fe5e79b5..58462f0d 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/inbound_popup.php +++ b/agc_2-X/trunk/LANG_www/agc_es/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_es/live_exten_check.php b/agc_2-X/trunk/LANG_www/agc_es/live_exten_check.php index 912854ad..789b6c22 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/live_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_es/live_exten_check.php @@ -27,6 +27,7 @@ # 50711-1204 - removed HTTP authentication in favor of user/pass vars # 60103-1541 - added favorite extens status display # 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES +# 60619-1203 - Added variable filters to close security holes for login form # require("dbconnect.php"); @@ -51,11 +52,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 = '1.1.12'; +$build = '60619-1203'; $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/manager_send.php b/agc_2-X/trunk/LANG_www/agc_es/manager_send.php index 930f11d9..d180fb1e 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_es/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 de estas variables No es válido:\n"; + echo "Canal $channel debe ser mayor de 2 caracteres\n"; + echo "ExtraCanal $extrachannel debe ser mayor de 2 caracteres\n"; + echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; + echo "exten $exten debe ser fijado\n"; + echo "ext_context $ext_context debe ser fijado\n"; + echo "ext_priority $ext_priority debe ser fijado\n"; + echo "\nRedirect Action no enviado\n"; + } + else + { + if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + + $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveX=0; + echo "Canal $channel no está activo en $call_server_ip, Redirect comando no insertado\n"; + } + } + $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0]==0) + { + $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $rowx=mysql_fetch_row($rslt); + if ($rowx[0]==0) + { + $channel_liveY=0; + echo "Canal $channel no está activo en $server_ip, Redirect comando no insertado\n"; + } + } + if ( ($channel_liveX==1) && ($channel_liveY==1) ) + { + $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 no insertado\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 a Canal $channel en $call_server_ip and \nHungup $extrachannel en $server_ip\n"; + } + } + else + { + if ($channel_liveX==1) + {$ACTION="Redirect"; $server_ip = $call_server_ip;} + if ($channel_liveY==1) + {$ACTION="Redirect"; $channel=$extrachannel;} + + } + } +} + if ($ACTION=="RedirectXtra") { if ($channel=="$extrachannel") diff --git a/agc_2-X/trunk/LANG_www/agc_es/park_calls_display.php b/agc_2-X/trunk/LANG_www/agc_es/park_calls_display.php index 0f8c81ab..20b4c114 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/park_calls_display.php +++ b/agc_2-X/trunk/LANG_www/agc_es/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_es/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php index cdfefd97..a6972d51 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_es/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 "Campaña $campaign No es válido\n"; + echo "lead_id $lead_id No es válido\n"; + exit; + } + else + { + ### grab the call and lead info from the vicidial_live_agents table + $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and 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 LLAMADABK, change vicidial_callback record to INACTIVE if (eregi("CALLBK|CBHVIEJO", $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 en the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); + if ($no_delete_sessions < 1) + { + ##### Remove the reservation en the vicidial_conferences meetme room + $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vc_remove = mysql_affected_rows($link); + } ##### Delete the vicidial_live_agents record for this session $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; 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 95ffa8a2..4d230270 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php @@ -112,6 +112,17 @@ # 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 # require("dbconnect.php"); @@ -157,8 +168,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '1.1.86'; -$build = '60804-1710'; +$version = '2.0.96'; +$build = '60821-1643'; if ($force_logout) { @@ -166,6 +177,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 +186,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 +199,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 en 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 en 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 +241,7 @@ if ($campaign_login_list > 0) $camp_form_code = "\n"; @@ -261,7 +283,7 @@ echo "\n"; echo "