From 5eed8b273cf3507c5772b24b59a883fa495e6a4a Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 27 Mar 2017 21:10:56 +0000 Subject: [PATCH] Added USER_CUSTOM_ options to campaign custom callerID setting to allow for custom caller IDs to be used per agent in MANUAL and INBOUND_MAN modes git-svn-id: svn://192.168.202.10@2715 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 3 ++ extras/MySQL_AST_CREATE_tables.sql | 4 +-- extras/upgrade_2.14.sql | 4 +++ www/agc/vdc_db_query.php | 55 ++++++++++++++++++++++++++---- www/vicidial/admin.php | 9 ++--- www/vicidial/help.php | 3 +- 6 files changed, 65 insertions(+), 13 deletions(-) diff --git a/UPGRADE b/UPGRADE index f11a2159..21049678 100644 --- a/UPGRADE +++ b/UPGRADE @@ -133,6 +133,9 @@ OTHER CHANGES: 25. Added Drop Lists feature, allowing you to add new leads to a list built from DROPped calls from inbound groups on a scheduled basis. +26. Added USER_CUSTOM_ options to campaign custom callerID setting to allow for + custom caller IDs to be used per agent in MANUAL and INBOUND_MAN modes + diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 5f4f1afa..f4f5a14d 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -861,7 +861,7 @@ dispo_call_url TEXT, xferconf_c_number VARCHAR(50) default '', xferconf_d_number VARCHAR(50) default '', xferconf_e_number VARCHAR(50) default '', -use_custom_cid ENUM('Y','N','AREACODE') default 'N', +use_custom_cid ENUM('Y','N','AREACODE','USER_CUSTOM_1','USER_CUSTOM_2','USER_CUSTOM_3','USER_CUSTOM_4','USER_CUSTOM_5') default 'N', scheduled_callbacks_alert ENUM('NONE','BLINK','RED','BLINK_RED','BLINK_DEFER','RED_DEFER','BLINK_RED_DEFER') default 'NONE', queuemetrics_callstatus_override ENUM('DISABLED','NO','YES') default 'DISABLED', extension_appended_cidname ENUM('Y','N') default 'N', @@ -3940,4 +3940,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version'; UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1497',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1498',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.14.sql b/extras/upgrade_2.14.sql index ad6d233f..b434acb9 100644 --- a/extras/upgrade_2.14.sql +++ b/extras/upgrade_2.14.sql @@ -170,3 +170,7 @@ DROP INDEX drop_date on vicidial_drop_log_archive; CREATE UNIQUE INDEX vicidial_drop_log_archive_key on vicidial_drop_log_archive(drop_date, uniqueid); UPDATE system_settings SET db_schema_version='1497',db_schema_update_date=NOW() where db_schema_version < 1497; + +ALTER TABLE vicidial_campaigns MODIFY use_custom_cid ENUM('Y','N','AREACODE','USER_CUSTOM_1','USER_CUSTOM_2','USER_CUSTOM_3','USER_CUSTOM_4','USER_CUSTOM_5') default 'N'; + +UPDATE system_settings SET db_schema_version='1498',db_schema_update_date=NOW() where db_schema_version < 1498; diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 27415bc0..cebf4563 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -425,13 +425,14 @@ # 170228-1625 - Fix to prevent double-logging when emergency logout happens # 170309-0704 - Small fix for INBOUND_MAN agent logging issue # 170309-1550 - Added campaign agent_xfer_validation option +# 170327-1656 - Added USER_CUSTOM_ options to campaign custom callerID setting # -$version = '2.14-319'; -$build = '170309-1550'; +$version = '2.14-320'; +$build = '170327-1656'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=658; +$mysql_log_count=661; $one_mysql_log=0; $DB=0; $VD_login=0; @@ -2903,7 +2904,7 @@ if ($ACTION == 'manDiaLnextCaLL') $vulnl_new_sum=0; $stmt="SELECT sum(new_count) from vicidial_user_list_new_lead where user='$user';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00659',$user,$server_ip,$session_name,$one_mysql_log);} $vulnlags_ct = mysqli_num_rows($rslt); if ($vulnlags_ct > 0) { @@ -3916,7 +3917,28 @@ if ($ACTION == 'manDiaLnextCaLL') $row=mysqli_fetch_row($rslt); $use_custom_cid = $row[0]; $manual_dial_hopper_check = $row[1]; - if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) + if ( (preg_match('/^USER_CUSTOM/', $use_custom_cid)) and ($cid_lock < 1) ) + { + $temp_vu=''; + $use_custom_cid=preg_replace('/^USER_/', "", $use_custom_cid); + $pattern=array('/1/', '/2/', '/3/', '/4/', '/5/'); + $replace=array('one', 'two', 'three', 'four', 'five'); + $use_custom_cid = strtolower(preg_replace($pattern,$replace, $use_custom_cid)); + $stmt="select $use_custom_cid from vicidial_users where user='$user'"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00660',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vu_ct = mysqli_num_rows($rslt); + $act=0; + while ($vu_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vu = $row[0]; + $act++; + } + $temp_CID = preg_replace("/\D/",'',$temp_vu); + } + else if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) { $temp_vcca=''; $temp_ac=''; @@ -4861,7 +4883,28 @@ if ($ACTION == 'manDiaLonly') $row=mysqli_fetch_row($rslt); $use_custom_cid = $row[0]; $manual_dial_hopper_check = $row[1]; - if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) + if ( (preg_match('/^USER_CUSTOM/', $use_custom_cid)) and ($cid_lock < 1) ) + { + $temp_vu=''; + $use_custom_cid=preg_replace('/^USER_/', "", $use_custom_cid); + $pattern=array('/1/', '/2/', '/3/', '/4/', '/5/'); + $replace=array('one', 'two', 'three', 'four', 'five'); + $use_custom_cid = strtolower(preg_replace($pattern,$replace, $use_custom_cid)); + $stmt="select $use_custom_cid from vicidial_users where user='$user'"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00661',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vu_ct = mysqli_num_rows($rslt); + $act=0; + while ($vu_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vu = $row[0]; + $act++; + } + $temp_CID = preg_replace("/\D/",'',$temp_vu); + } + else if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) { $temp_vcca=''; $temp_ac=''; diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 65db8e56..0cbf7cb1 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -2802,7 +2802,6 @@ if ($non_latin < 1) $my_callback_option = preg_replace('/[^0-9a-zA-Z]/','',$my_callback_option); $auto_pause_precall_code = preg_replace('/[^0-9a-zA-Z]/','',$auto_pause_precall_code); $disable_dispo_status = preg_replace('/[^0-9a-zA-Z]/','',$disable_dispo_status); - $use_custom_cid = preg_replace('/[^0-9a-zA-Z]/','',$use_custom_cid); $action_xfer_cid = preg_replace('/[^0-9a-zA-Z]/','',$action_xfer_cid); $callback_list_calltime = preg_replace('/[^0-9a-zA-Z]/','',$callback_list_calltime); $pause_after_next_call = preg_replace('/[^0-9a-zA-Z]/','',$pause_after_next_call); @@ -3107,6 +3106,7 @@ if ($non_latin < 1) $duplicate_check = preg_replace('/[^-_0-9a-zA-Z]/','',$duplicate_check); $dl_times = preg_replace('/[^-_0-9a-zA-Z]/','',$dl_times); $dl_monthdays = preg_replace('/[^-_0-9a-zA-Z]/','',$dl_monthdays); + $use_custom_cid = preg_replace('/[^-_0-9a-zA-Z]/','',$use_custom_cid); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_timeout_prompt); @@ -4058,12 +4058,13 @@ else # 170320-1340 - Added conf_qualify phones option for IAX # 170321-1100 - Added pause code time limits warning feature # 170327-0704 - Added Drop Lists section +# 170327-1655 - Added USER_CUSTOM_ options to campaign custom callerID setting # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-604a'; -$build = '170327-0704'; +$admin_version = '2.14-605a'; +$build = '170327-1655'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -21688,7 +21689,7 @@ if ($ADD==31) {echo " "._QXZ("LIST OVERRIDE ACTIVE")."";} echo "\n"; - echo ""._QXZ("Custom CallerID").": $NWB#campaigns-use_custom_cid$NWE\n"; + echo ""._QXZ("Custom CallerID").": $NWB#campaigns-use_custom_cid$NWE\n"; if ($SSoutbound_autodial_active > 0) { diff --git a/www/vicidial/help.php b/www/vicidial/help.php index 30f88223..4a9a7417 100644 --- a/www/vicidial/help.php +++ b/www/vicidial/help.php @@ -118,6 +118,7 @@ # 170321-1130 - Added pause code limits entries # 170322-1720 - Added filter-phone-list entry # 170326-1135 - Added drop lists entries +# 170327-1649 - updated the campaigns-use_custom_cid entry # @@ -1402,7 +1403,7 @@ if ($SSoutbound_autodial_active > 0)

- - + -