From 95c9f1f3d32afe6957e99d153b2f8018a0214a09 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 14 Jun 2011 11:33:59 +0000 Subject: [PATCH] Added reset_lead option to the non-agent-api update_lead function Fixed a minor bug related to 2-hour manual dial calls git-svn-id: svn://192.168.202.10@1674 3d104415-ff17-0410-8863-d5cf3c621b8a --- docs/NON-AGENT_API.txt | 3 +- .../TO_BE_TRANSLATED_2.4.txt | 2 + www/agc/conf_exten_check.php | 104 +++++++++++------- www/vicidial/non_agent_api.php | 9 +- 4 files changed, 74 insertions(+), 44 deletions(-) diff --git a/docs/NON-AGENT_API.txt b/docs/NON-AGENT_API.txt index efe98471..75546352 100644 --- a/docs/NON-AGENT_API.txt +++ b/docs/NON-AGENT_API.txt @@ -58,7 +58,7 @@ Changes: 110409-0822 - Added run_time logging of API functions 110424-0854 - Added option for time zone code lookups using owner field in add_lead function 110529-1220 - Added time zone information output to version function - +110614-0726 - Added reset_lead option to update_lead function(issue #502) @@ -423,6 +423,7 @@ custom_fields - Y or N, default is N. Defines whether the API will accept custo no_update - Y or N, Setting this to Y will not perform any updates, but will instead only tell you if a lead exists that matches the search criteria, default is N. delete_lead - Y or N, Setting this to Y will delete the lead from the vicidial_list table, default is N. +reset_lead - Y or N, Setting this to Y will reset the called-since-last-reset flag of the lead, default is N. EDITABLE FIELDS- user_field - 1-20 characters, this updates the 'user' field in the vicidial_list table diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 4f0f483d..085ab9fc 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -598,6 +598,8 @@ Scheduled Callbacks Days Limit|| This option allows you to reduce the agent scheduled callbacks calendar to a selectable number of days from today, the full 12 month calendar will still be displayed, but only the set number of days will be selectable. Default is 0 for unlimited|| Dial Level Difference Target Method|| This option allows you to define whether the dial level difference target setting is applied only to the calculation of the dial level or also to the actual dialing on each dialing server. If you are running a small campaign with agents logged in on many servers you may want to use the ADAPT_CALC_ONLY option, because the CALLS_PLACED option may result in fewer calls being placed than deisred. This option is only active if Dial Level Difference Target is set to something other than 0. Default is ADAPT_CALC_ONLY|| +If you want to use custom fields in a web form address, you need to add|| +as part of your URL|| admin_campaign_multi_alt.php diff --git a/www/agc/conf_exten_check.php b/www/agc/conf_exten_check.php index 2b26d37a..90f9f1d9 100644 --- a/www/agc/conf_exten_check.php +++ b/www/agc/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -54,12 +54,13 @@ # 100727-2209 - Added timer actions for hangup, extension, callmenu and ingroup as well as destination # 101123-1105 - Added api manual dial queue feature to external_dial function # 101208-0308 - Moved the Calls in Queue count and other counts outside of the autodial section (issue 406) +# 110610-0059 - Small fix for manual dial calls lasting more than 100 minutes in real-time report # -$version = '2.4-29'; -$build = '101208-0308'; +$version = '2.4-30'; +$build = '110610-0059'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=36; +$mysql_log_count=38; $one_mysql_log=0; $DB=0; @@ -112,10 +113,15 @@ if ($qm_conf_ct > 0) ########################################### if ($non_latin < 1) -{ -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -} + { + $user=ereg_replace("[^-_0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass); + } +else + { + $user = ereg_replace("'|\"|\\\\|;","",$user); + $pass = ereg_replace("'|\"|\\\\|;","",$pass); + } # default optional vars if not set if (!isset($format)) {$format="text";} @@ -149,7 +155,6 @@ if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) } else { - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; @@ -176,30 +181,29 @@ else } if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) + echo "\n"; + echo "\n"; + echo "\n"; + echo "Conf Extension Check"; + echo "\n"; + echo "\n"; + echo "\n"; + } + +if ($ACTION == 'refresh') + { + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if (strlen($conf_exten)<1) { $channel_live=0; echo "Conf Exten $conf_exten is not valid\n"; exit; } - else + else { - if ($client == 'vdc') { $Acount=0; @@ -321,6 +325,15 @@ echo " $row=mysql_fetch_row($rslt); $AcalleridCOUNT=$row[0]; + if ( ($AcalleridCOUNT > 0) and (eregi("INCALL",$Astatus)) and (preg_match("/^M/",$Acallerid)) ) + { + $updateNOW_TIME = date("Y-m-d H:i:s"); + $stmt="UPDATE vicidial_auto_calls set last_update_time='$updateNOW_TIME' where callerid='$Acallerid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03038',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ( ($AcalleridCOUNT < 1) and (eregi("INCALL",$Astatus)) and (strlen($Aagent_log_id) > 0) ) { $DEADcustomer++; @@ -374,6 +387,15 @@ echo " $row=mysql_fetch_row($rslt); $AcalleridCOUNT=$row[0]; + if ( ($AcalleridCOUNT > 0) and (eregi("INCALL",$Astatus)) ) + { + $updateNOW_TIME = date("Y-m-d H:i:s"); + $stmt="UPDATE vicidial_auto_calls set last_update_time='$updateNOW_TIME' where callerid='$Acallerid';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03037',$user,$server_ip,$session_name,$one_mysql_log);} + } + if ( ($AcalleridCOUNT < 1) and (eregi("INCALL",$Astatus)) and (strlen($Aagent_log_id) > 0) ) { $DEADcustomer++; @@ -678,40 +700,40 @@ echo " if ($format=='debug') {echo "\n";} } } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; + $channels_list = ($channels_list + $sip_list); + echo "$channels_list|"; - $counter=0; - $countecho=''; - while($total_conf > $counter) + $counter=0; + $countecho=''; + while($total_conf > $counter) { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; + $counter++; + $countecho = "$countecho$ChannelA[$counter] ~"; + # echo "$ChannelA[$counter] ~"; } echo "$countecho\n"; } - if ($ACTION == 'register') +if ($ACTION == 'register') { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) { $channel_live=0; echo "Conf Exten $conf_exten is not valid or Exten $exten is not valid\n"; exit; } - else + else { $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03013',$user,$server_ip,$session_name,$one_mysql_log);} } - echo "Conference $conf_exten has been registered to $exten\n"; + echo "Conference $conf_exten has been registered to $exten\n"; } diff --git a/www/vicidial/non_agent_api.php b/www/vicidial/non_agent_api.php index 7e01fbe4..db332855 100644 --- a/www/vicidial/non_agent_api.php +++ b/www/vicidial/non_agent_api.php @@ -48,10 +48,11 @@ # 110409-0822 - Added run_time logging of API functions # 110424-0854 - Added option for time zone code lookups using owner field # 110529-1220 - Added time zone information output to version function +# 110614-0726 - Added reset_lead option to update_lead function(issue #502) # -$version = '2.4-34'; -$build = '110529-1220'; +$version = '2.4-35'; +$build = '110614-0726'; $startMS = microtime(); @@ -244,6 +245,8 @@ if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} if (isset($_GET["tz_method"])) {$tz_method=$_GET["tz_method"];} elseif (isset($_POST["tz_method"])) {$tz_method=$_POST["tz_method"];} +if (isset($_GET["reset_lead"])) {$reset_lead=$_GET["reset_lead"];} + elseif (isset($_POST["reset_lead"])) {$reset_lead=$_POST["reset_lead"];} header ("Content-type: text/html; charset=utf-8"); @@ -370,6 +373,7 @@ if ($non_latin < 1) $reset_time=ereg_replace("[^-_0-9]","",$reset_time); $uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); $tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); + $reset_lead = ereg_replace("[^A-Z]","",$reset_lead); } else { @@ -3283,6 +3287,7 @@ if ($function == 'update_lead') if (strlen($rank)>0) {$VL_update_SQL .= "rank='$rank',";} if (strlen($owner)>0) {$VL_update_SQL .= "owner='$owner',";} if (strlen($called_count)>0) {$VL_update_SQL .= "called_count='$called_count',";} + if ( (strlen($reset_lead) > 0 && $reset_lead == 'Y') ) {$VL_update_SQL .= "called_since_last_reset='N',";} $VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL); $VL_update_SQL = preg_replace("/'--BLANK--'/","''",$VL_update_SQL); $VL_update_SQL = preg_replace("/\n/","!N",$VL_update_SQL);