diff --git a/UPGRADE b/UPGRADE index 828c848b..b673d698 100644 --- a/UPGRADE +++ b/UPGRADE @@ -693,6 +693,9 @@ OTHER CHANGES: 158. Added options in Call Menus to allow for invalid action on second or third invalid selection by the caller instead of just the first. +159. Added ability to set custom callerID numbers per campaign for outbound + calls by areacode. You can even set multiple callerIDs per areacode. + diff --git a/bin/AST_VDauto_dial.pl b/bin/AST_VDauto_dial.pl index 5de2d161..dd6469bc 100644 --- a/bin/AST_VDauto_dial.pl +++ b/bin/AST_VDauto_dial.pl @@ -105,6 +105,7 @@ # 110723-1256 - Added extra debug for vac deletes and fix for long ring/drop time # 110731-2127 - Added sections for handling MULTI_LEAD auto-alt-dial and na-call-url functions # 110809-1516 - Added section for noanswer logging +# 110901-1125 - Added campaign areacode cid function # @@ -1158,7 +1159,30 @@ while($one_day_interval > 0) if (length($temp_CID) > 6) {$CCID = "$temp_CID"; $CCID_on++;} } - + if ($DBIPuse_custom_cid[$user_CIPct] =~ /AREACODE/) + { + $temp_CID=''; + $temp_vcca=''; + $temp_ac = substr("$phone_number", 0, 3); + $stmtA = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $temp_vcca = $aryA[0]; + $sthA->finish(); + + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $affected_rows = $dbhA->do($stmtA); + } + $temp_CID = $temp_vcca; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} + } + if ($DBIPdialprefix[$user_CIPct] =~ /x/i) {$Local_out_prefix = '';} if ($RECcount) diff --git a/bin/AST_VDauto_dial_FILL.pl b/bin/AST_VDauto_dial_FILL.pl index f08f98fc..b6937163 100644 --- a/bin/AST_VDauto_dial_FILL.pl +++ b/bin/AST_VDauto_dial_FILL.pl @@ -12,7 +12,7 @@ # # Should only be run on one server in a multi-server Asterisk/VICIDIAL cluster # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 61115-1246 - First build, framework setup, non-functional @@ -30,6 +30,7 @@ # 100205-1245 - Added optional stagger sending of calls across all available servers in each rank # 100903-0041 - Changed lead_id max length to 10 digits # 101207-0713 - Added more info to Originate for rare VDAC issue +# 110901-1127 - Added campaign areacode cid function # ### begin parsing run-time options ### @@ -752,6 +753,30 @@ while($one_day_interval > 0) if (length($temp_CID) > 6) {$CCID = "$temp_CID"; $CCID_on++;} } + if ($DBIPuse_custom_cid[$camp_CIPct] =~ /AREACODE/) + { + $temp_CID=''; + $temp_vcca=''; + $temp_ac = substr("$phone_number", 0, 3); + $stmtA = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$DBfill_campaign[$camp_CIPct]' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $temp_vcca = $aryA[0]; + $sthA->finish(); + + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBfill_campaign[$camp_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $affected_rows = $dbhA->do($stmtA); + } + $temp_CID = $temp_vcca; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} + } + if ($DBIPdialprefix[$camp_CIPct] =~ /x/i) {$Local_out_prefix = '';} if ($RECcount) diff --git a/docs/Sangoma_Netborder_CPD_Walkthrough.txt b/docs/Sangoma_Netborder_CPD_Walkthrough.txt index 208a8710..a552852c 100644 --- a/docs/Sangoma_Netborder_CPD_Walkthrough.txt +++ b/docs/Sangoma_Netborder_CPD_Walkthrough.txt @@ -110,3 +110,35 @@ INSERT INTO vicidial_statuses values('CPDSV','CPD Sit-Vacant','N','N','UNDEFINED INSERT INTO vicidial_statuses values('CPDUK','CPD Unknown','N','N','UNDEFINED','N','N','N','N','N','N'); INSERT INTO vicidial_statuses values('CPDERR','CPD Error','N','N','UNDEFINED','N','N','N','N','N','N'); + + + + + +Marketing Description of the Sangoma Netborder Call Analyzer: + +Call Progress Analysis is the process of detecting pre-connect information about failed outbound call attempts and the destination party’s media type for connected outbound calls. + +Strictly speaking, Call Progress Analysis (CPA) is the automated determination by a piece of telecommunications equipment as to the result of dialing a number. For example, the result of the analysis might be a busy tone, an answered call, ringing at the other end but no answer after a preset number of rings or after a specified duration of time, and so on. The analysis involves detecting the various call progress tones generated by the telephone network as the call is put through. + +Traditional Call Progress Analysis implementations rely on simple rule-based algorithms, which provide sub-optimal accuracy of speed of processing, leading to significant inefficiencies in operations. In a number of real-life campaigns, dialing applications often reach their target in less than 30% of the call attempts. + +Call Analyzer's Call Progress Analysis engine is patent-pending technology that is built on statistical models that represent the potential outcomes of call attempts. The result is a virtual machine that learns the patterns of what constitutes a call attempt that result in a voice mail versus a live human versus a special intercept tone, etc. The Call Analyzer functions much like the human brain and is able to adapt to a wide variety of noise conditions, ringing patterns and telecom network conditions. + +Sangoma has run its own internal benchmarking of various technologies, out of the box, without tuning; using a database of live recordings of approximately 5000 calls. Sangoma provides 15% increase in accuracy over competing technologies. While this does not constitute a guarantee, live deployments should experience similar results and performance over a statistically significant sample of calls. + +Features: + * Best-in-industry accuracy and response time + With patent-pending algorithms, NetBorder Call Analyzer delivers the highest accuracy and fastest call delivery rates available for automated calling applications. + * Optimized Detection + o Configurable pre-connect tone detection + o Post-connect analysis + o End of Greeting + * Resilient against different calling conditions + Statistical models used by NetBorder Call Analyzer are robust, regardless of background noise and network conditions. + * Integrate via Standards-Based SIP + No proprietary Application Programming Interfaces. Support for both PSTN and VoIP networks. + * Operate in a dynamic environment + Call progress confidence measures enable the system to adapt according to contact center operating conditions. + * Streamlined tuning process The statistical approach eliminates the need for long and frequent tuning cycles of the call progress parameters. + diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index eafa4cc1..7de9fdf5 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -766,7 +766,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') default 'N', +use_custom_cid ENUM('Y','N','AREACODE') 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', @@ -1429,7 +1429,8 @@ alt_log_dbname VARCHAR(50) default '', alt_log_login VARCHAR(50) default '', alt_log_pass VARCHAR(50) default '', tables_use_alt_log_db VARCHAR(2000) default '', -did_agent_log ENUM('Y','N') default 'N' +did_agent_log ENUM('Y','N') default 'N', +campaign_cid_areacodes_enabled ENUM('0','1') default '1' ); CREATE TABLE vicidial_campaigns_list_mix ( @@ -2471,6 +2472,19 @@ index (extension), index (call_date) ); +CREATE TABLE vicidial_campaign_cid_areacodes ( +campaign_id VARCHAR(8) NOT NULL, +areacode VARCHAR(5) NOT NULL, +outbound_cid VARCHAR(20), +active ENUM('Y','N','') default '', +cid_description VARCHAR(50), +call_count_today MEDIUMINT(7) default '0', +index (campaign_id), +index (areacode) +); + +CREATE UNIQUE INDEX campareacode on vicidial_campaign_cid_areacodes (campaign_id, areacode, outbound_cid); + ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY; @@ -2636,7 +2650,7 @@ CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer; CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log; CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route); -UPDATE system_settings SET db_schema_version='1294',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1295',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/extras/upgrade_2.4.sql b/extras/upgrade_2.4.sql index bcb231ed..c0dd341e 100644 --- a/extras/upgrade_2.4.sql +++ b/extras/upgrade_2.4.sql @@ -1006,3 +1006,22 @@ UPDATE system_settings SET db_schema_version='1293',db_schema_update_date=NOW() ALTER TABLE vicidial_campaigns ADD survey_recording ENUM('Y','N') default 'N'; UPDATE system_settings SET db_schema_version='1294',db_schema_update_date=NOW() where db_schema_version < 1294; + +ALTER TABLE system_settings ADD campaign_cid_areacodes_enabled ENUM('0','1') default '1'; + +ALTER TABLE vicidial_campaigns MODIFY use_custom_cid ENUM('Y','N','AREACODE') default 'N'; + +CREATE TABLE vicidial_campaign_cid_areacodes ( +campaign_id VARCHAR(8) NOT NULL, +areacode VARCHAR(5) NOT NULL, +outbound_cid VARCHAR(20), +active ENUM('Y','N','') default '', +cid_description VARCHAR(50), +call_count_today MEDIUMINT(7) default '0', +index (campaign_id), +index (areacode) +); + +CREATE UNIQUE INDEX campareacode on vicidial_campaign_cid_areacodes (campaign_id, areacode, outbound_cid); + +UPDATE system_settings SET db_schema_version='1295',db_schema_update_date=NOW() where db_schema_version < 1295; 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 6698e196..bbb3f23e 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -702,6 +702,24 @@ This option will log the inbound DID calls along with an in-group and user ID, i TIMEOUT will allow you to set what happens to the call when it times out with no input from the caller. INVALID will allow you to set what happens when the caller enters an invalid option. INVALID_2ND and 3RD can only be active if INVALID is not used, it will wait until the second or third invalid entry by the caller before it executes the option|| Survey Recording|| If enabled, this will start recording when the call is answered. Only recommended if the method is not set to transfer to an agent. Default is N for disabled|| +Campaign Areacode CID|| +AREACODE CIDS FOR THIS CAMPAIGN|| +ADD NEW AREACODE CID|| +AREACODE|| +SUBMIT CHANGES|| +AREACODE CID NOT ADDED|| +there is already an entry for this campaign with this CID|| +AREACODE CID ADDED|| +AREACODE CID NOT DELETED|| +this entry does not exist|| +AREACODE CID DELETED|| +AREACODE CID MODIFIED|| +Campaign Areacode CID Modify|| +CAMPAIGN AREACODE CID LISTINGS|| +When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode|| +Enable Campaign Areacode CID|| +This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled|| +If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used|| lead_report_export.php diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index c7995772..e43239c4 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -289,10 +289,11 @@ # 110718-1158 - Added logging of skipped leads # 110723-2256 - Added disable_alter_custphone HIDE option for call logs display # 110731-2318 - Added dispo/start call url logging to DB table +# 110901-1117 - Added areacode custom cid function # -$version = '2.4-192'; -$build = '110731-2318'; +$version = '2.4-193'; +$build = '110901-1117'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=425; $one_mysql_log=0; @@ -2332,7 +2333,7 @@ if ($ACTION == 'manDiaLnextCaLL') if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} ### check for custom cid use $use_custom_cid=0; - $stmt = "SELECT count(*) FROM vicidial_campaigns where use_custom_cid='Y' and campaign_id='$campaign';"; + $stmt = "SELECT use_custom_cid FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00313',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -2341,13 +2342,32 @@ if ($ACTION == 'manDiaLnextCaLL') { $row=mysql_fetch_row($rslt); $use_custom_cid = $row[0]; - } - if ($use_custom_cid > 0) - { - $temp_CID = preg_replace("/\D/",'',$security); + if ($use_custom_cid == 'AREACODE') + { + $temp_ac = substr("$agent_dialed_number", 0, 3); + $stmt = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcca_ct = mysql_num_rows($rslt); + if ($vcca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $temp_vcca = $row[0]; + + $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + $temp_CID = preg_replace("/\D/",'',$temp_vcca); + } + if ($use_custom_cid == 'Y') + {$temp_CID = preg_replace("/\D/",'',$security);} if (strlen($temp_CID) > 6) {$CCID = "$temp_CID"; $CCID_on++;} } + if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} $PADlead_id = sprintf("%010s", $lead_id); @@ -2901,7 +2921,7 @@ if ($ACTION == 'manDiaLonly') if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} ### check for custom cid use $use_custom_cid=0; - $stmt = "SELECT count(*) FROM vicidial_campaigns where use_custom_cid='Y' and campaign_id='$campaign';"; + $stmt = "SELECT use_custom_cid FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00314',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -2910,10 +2930,28 @@ if ($ACTION == 'manDiaLonly') { $row=mysql_fetch_row($rslt); $use_custom_cid = $row[0]; - } - if ($use_custom_cid > 0) - { - $temp_CID = preg_replace("/\D/",'',$security); + if ($use_custom_cid == 'AREACODE') + { + $temp_ac = substr("$phone_number", 0, 3); + $stmt = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcca_ct = mysql_num_rows($rslt); + if ($vcca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $temp_vcca = $row[0]; + + $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + $temp_CID = preg_replace("/\D/",'',$temp_vcca); + } + if ($use_custom_cid == 'Y') + {$temp_CID = preg_replace("/\D/",'',$security);} if (strlen($temp_CID) > 6) {$CCID = "$temp_CID"; $CCID_on++;} } diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index aa02db60..09223409 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -1615,6 +1615,12 @@ if (isset($_GET["did_agent_log"])) {$did_agent_log=$_GET["did_agent_log"];} elseif (isset($_POST["did_agent_log"])) {$did_agent_log=$_POST["did_agent_log"];} if (isset($_GET["survey_recording"])) {$survey_recording=$_GET["survey_recording"];} elseif (isset($_POST["survey_recording"])) {$survey_recording=$_POST["survey_recording"];} +if (isset($_GET["campaign_cid_areacodes_enabled"])) {$campaign_cid_areacodes_enabled=$_GET["campaign_cid_areacodes_enabled"];} + elseif (isset($_POST["campaign_cid_areacodes_enabled"])) {$campaign_cid_areacodes_enabled=$_POST["campaign_cid_areacodes_enabled"];} +if (isset($_GET["areacode"])) {$areacode=$_GET["areacode"];} + elseif (isset($_POST["areacode"])) {$areacode=$_POST["areacode"];} +if (isset($_GET["cid_description"])) {$cid_description=$_GET["cid_description"];} + elseif (isset($_POST["cid_description"])) {$cid_description=$_POST["cid_description"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -1628,7 +1634,7 @@ if (strlen($dial_status) > 0) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -1656,6 +1662,7 @@ if ($qm_conf_ct > 0) $SSvoicemail_timezones = $row[18]; $SSdefault_voicemail_timezone = $row[19]; $SSdefault_local_gmt = $row[20]; + $SScampaign_cid_areacodes_enabled = $row[21]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -1864,6 +1871,8 @@ if ($non_latin < 1) $queuemetrics_pe_phone_append = ereg_replace("[^0-9]","",$queuemetrics_pe_phone_append); $test_campaign_calls = ereg_replace("[^0-9]","",$test_campaign_calls); $agents_calls_reset = ereg_replace("[^0-9]","",$agents_calls_reset); + $campaign_cid_areacodes_enabled = ereg_replace("[^0-9]","",$campaign_cid_areacodes_enabled); + $areacode = ereg_replace("[^0-9]","",$areacode); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1935,7 +1944,6 @@ if ($non_latin < 1) $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); $is_webphone = ereg_replace("[^NY]","",$is_webphone); $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); - $use_custom_cid = ereg_replace("[^NY]","",$use_custom_cid); $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); @@ -2023,6 +2031,7 @@ if ($non_latin < 1) $my_callback_option = ereg_replace("[^0-9a-zA-Z]","",$my_callback_option); $auto_pause_precall_code = ereg_replace("[^0-9a-zA-Z]","",$auto_pause_precall_code); $disable_dispo_status = ereg_replace("[^0-9a-zA-Z]","",$disable_dispo_status); + $use_custom_cid = ereg_replace("[^0-9a-zA-Z]","",$use_custom_cid); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -2380,6 +2389,7 @@ if ($non_latin < 1) $filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number); $label_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_name); $default_local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$cid_description); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -2840,12 +2850,13 @@ else # 110822-1204 - Added did_agent_log System Settings option # 110829-1600 - Added multiple invalid option to Call Menus # 110829-2129 - Added survey recording option +# 110831-2038 - Added Campaign Areacode CID features # # 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 -$admin_version = '2.4-333a'; -$build = '110829-2129'; +$admin_version = '2.4-334a'; +$build = '110831-2038'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -3136,6 +3147,7 @@ if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "New Agent Pause Code";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Added";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Added";} if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Campaign Preset Added";} +if ($ADD==202) {$hh='campaigns'; $sh='accid'; echo "Campaign Areacode CID Modify";} if ($ADD==211) {$hh='lists'; echo "New List Addition";} if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} if ($ADD==2011) {$hh='ingroups'; echo "New Copied In-Group Addition";} @@ -3183,6 +3195,7 @@ if ($ADD==31) if ($SUB==29) {echo " - List Mixes";} if ($SUB=='20A') {echo " - Survey";} if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==34) { @@ -3196,6 +3209,7 @@ if ($ADD==34) if ($SUB==29) {echo " - List Mixes";} if ($SUB=='20A') {echo " - Survey";} if ($SUB==201) {echo " - Presets";} + if ($SUB==202) {echo " - AC-CID";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Campaign Statuses";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaign HotKeys";} @@ -3205,6 +3219,7 @@ if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Campaign Agent Pause Codes" if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Statuses";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mixes";} if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Campaign Presets";} +if ($ADD==302) {$hh='campaigns'; $sh='accid'; echo "Campaign Areacode CID";} if ($ADD==311) {$hh='lists'; echo "Modify List";} if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} if ($ADD==3311) {$hh='ingroups'; echo "Modify DID";} @@ -4800,7 +4815,7 @@ if ($ADD==99999)

- Custom CallerID - When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N. + Custom CallerID - When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the Campaign CallerID defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N. When set to AREACODE you have the ability to go into the AC-CID submenu and define multiple callerids to be used per areacode.
@@ -6254,6 +6269,17 @@ if ($ADD==99999) +



+ + VICIDIAL CAMPAIGN CID AREACODES

+
+
+ If the System Setting for Areacode CIDs is enabled and the Campaign setting for Use Custom CallerID is set to AREACODE then you have the ability to define Areacode CIDs that will be used when outbound calling to leads in this specific campaign. You can add multiple callerIDs per areacode and you can activate and deactivate them each in real time. If more than one callerID is active for a specific areacode then the system will use the callerid that has been used the least number of times today. If no callerIDs are active for the areacode then the campaign CallerID or list override CallerID will be used. + + + + +



VICIDIAL_USER_GROUPS TABLE

@@ -7609,6 +7635,11 @@ if ($ADD==99999)
Enable Campaign Test Calls - This setting enables the ability to enter a phone code and phone number into fields at the bottom of the Campaign Detail screen and place a phone call to that number as if it were a lead being auto-dialed in the system. The phone number will be stored as a new lead in the manual dial list ID list. The campaign must be active for this feature to be enabled, and it is recommended that the lists assigned to the campaign all be set to inactive. The dial prefix, dial timeout and all other dialing related features, except for DNC and call time options, will affect the dialing of the test number. The phone call will be placed on the server selected as the voicemail server in the system settings. Default is 0 for disabled. +
+
+
+ Enable Campaign Areacode CID - This setting enables the ability to set specific outbound callerid numbers to be used per campaign. Default is 1 for enabled. +

@@ -11163,6 +11194,133 @@ if ($ADD==201) } +###################### +# ADD=202 adds/deletes/modifies areacode cid to the campaign +###################### +if ($ADD==202) + { + echo ""; + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' and areacode='$areacode' and outbound_cid='$outbound_cid';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
AREACODE CID NOT ADDED - there is already an entry for this campaign with this CID
\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
AREACODE CID NOT ADDED - Please go back and look at the data you entered
\n"; + } + else + { + echo "
AREACODE CID ADDED: $campaign_id - $areacode - $outbound_cid
\n"; + + $stmt="INSERT INTO vicidial_campaign_cid_areacodes(campaign_id,areacode,outbound_cid,cid_description) values('$campaign_id','$areacode','$outbound_cid','$cid_description');"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='ADD', record_id='$campaign_id', event_code='ADMIN ADD CAMPAIGN AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + if ($stage == 'DELETE') + { + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' and areacode='$areacode' and outbound_cid='$outbound_cid';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
AREACODE CID NOT DELETED - this entry does not exist
\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
AREACODE CID NOT DELETED - Please go back and look at the data you entered
\n"; + } + else + { + echo "
AREACODE CID DELETED: $campaign_id - $areacode - $outbound_cid
\n"; + + $stmt="DELETE FROM vicidial_campaign_cid_areacodes WHERE campaign_id='$campaign_id' and areacode='$areacode' and outbound_cid='$outbound_cid';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + if ($stage == 'MODIFY') + { + $stmt="SELECT areacode,outbound_cid,active,cid_description,call_count_today from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' order by areacode,outbound_cid"; + $rslt=mysql_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xareacode[$o] = $rowx[0]; + $Xoutbound_cid[$o] = $rowx[1]; + $Xactive[$o] = $rowx[2]; + $Xcid_description[$o] = $rowx[3]; + $Xcall_count_today[$o] = $rowx[4]; + $o++; + } + + $o=0; + while ($accids_to_print > $o) + { + $Factive_value=''; + $Fcid_description_value=''; + $Factive = "active_$Xareacode[$o]_$Xoutbound_cid[$o]"; + $Fcid_description = "cid_description_$Xareacode[$o]_$Xoutbound_cid[$o]"; + + if (isset($_GET[$Factive])) {$Factive_value=$_GET[$Factive];} + elseif (isset($_POST[$Factive])) {$Factive_value=$_POST[$Factive];} + if (isset($_GET[$Fcid_description])) {$Fcid_description_value=$_GET[$Fcid_description];} + elseif (isset($_POST[$Fcid_description])) {$Fcid_description_value=$_POST[$Fcid_description];} + $Fcid_description_value = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$Fcid_description_value); + $Factive_value = ereg_replace("[^A-Z]","",$Factive_value); + + # echo "$campaign_id - $Xareacode[$o] - $Xoutbound_cid[$o] - $Factive($Factive_value|$Xactive[$o]) - $Fcid_description($Fcid_description_value|$Xcid_description[$o])
"; + + if ( ($Factive_value == $Xactive[$o]) and ($Fcid_description_value == $Xcid_description[$o]) ) + { + # echo "
AREACODE CID NOT MODIFIED - Please go back and look at the data you entered
\n"; + } + else + { + echo "AREACODE CID MODIFIED: $Xareacode[$o] - $Xoutbound_cid[$o]
\n"; + + $stmt="UPDATE vicidial_campaign_cid_areacodes SET active='$Factive_value',cid_description='$Fcid_description_value' WHERE campaign_id='$campaign_id' and areacode='$Xareacode[$o]' and outbound_cid='$Xoutbound_cid[$o]';"; + $rslt=mysql_query($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGN_AC-CID', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN AC-CID', event_sql=\"$SQL_log\", event_notes='CID: $Xareacode[$o] - $Xoutbound_cid[$o]';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + $o++; + } + } + $SUB=202; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -16179,7 +16337,7 @@ if ($ADD==411111111111111) } $tables_use_alt_log_db = preg_replace("/,$/","",$new_altlog_value); - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log';"; + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled';"; $rslt=mysql_query($stmt, $link); if ($reload_dialplan_on_servers > 0) @@ -19520,9 +19678,11 @@ if ($ADD==31) else {$camp_survey_color=$campaigns_color;} if ($SUB==201) {$camp_preset_color=$subcamp_color;} else {$camp_preset_color=$campaigns_color;} + if ($SUB==202) {$camp_accid_color=$subcamp_color;} + else {$camp_accid_color=$campaigns_color;} + echo " $row[0]:
"; echo "\n"; - echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -19539,6 +19699,10 @@ if ($ADD==31) { echo ""; } + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo ""; + } if ($SSqc_features_active > 0) { echo ""; @@ -19994,7 +20158,7 @@ if ($ADD==31) {echo " LIST OVERRIDE ACTIVE";} echo "\n"; - echo "\n"; + echo "\n"; if ($SSoutbound_autodial_active > 0) { @@ -21125,6 +21289,92 @@ if ($ADD==31) echo "
\n"; } + + ##### CAMPAIGN AREACODE CID ##### + if ($SUB==202) + { + echo "

AREACODE CIDS FOR THIS CAMPAIGN:   $NWB#vicidial_campaign_cid_areacodes$NWE
\n"; + if ($use_custom_cid != 'AREACODE') + {echo "
The campaign setting Custom CallerID is not set to AREACODE!
";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
$row[0]: Basic   Basic Detail StatusesHotKeysPresetsAC-CIDQC
Custom CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
Custom CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
\n"; + echo "\n"; + + $stmt="SELECT areacode,outbound_cid,active,cid_description,call_count_today from vicidial_campaign_cid_areacodes where campaign_id='$campaign_id' order by areacode,outbound_cid"; + $rslt=mysql_query($stmt, $link); + $accids_to_print = mysql_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xareacode[$o] = $rowx[0]; + $Xoutbound_cid[$o] = $rowx[1]; + $Xactive[$o] = $rowx[2]; + $Xcid_description[$o] = $rowx[3]; + $Xcall_count_today[$o] = $rowx[4]; + $o++; + } + + $o=0; + while ($accids_to_print > $o) + { + $ct = ($o + 1); + if ($ct == '1') + { + $bgcolor='bgcolor="#9BB9FB"'; + $bgac = $Xareacode[$o]; + } + else + { + if ($Xareacode[$o] != $bgac) + { + if (eregi("1$|3$|5$|7$|9$", $bgct)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + $bgct++; + $bgac = $Xareacode[$o]; + } + } + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o++; + } + + echo "
#AREACODECID NUMBERDESCRIPTIONACTIVECALLSDELETE
  $ct   $Xareacode[$o]   $Xoutbound_cid[$o]\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   DELETE
\n"; + echo "

\n"; + + echo "
ADD NEW AREACODE CID
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Areacode: \n"; + echo "Outbound CID:
\n"; + echo "Description: \n"; + echo "
\n"; + + echo "

\n"; + } + + if ($SUB < 1) { echo "

\n"; @@ -22516,7 +22766,7 @@ if ($ADD==39) if ($ADD==301) { echo "
\n"; - echo ""; + echo ""; echo "
CAMPAIGN PRESET LISTINGS:\n"; echo "
\n"; @@ -22527,59 +22777,125 @@ if ($ADD==301) echo "\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $enable_xfer_presets_list[$o] = $row[2]; - $o++; - } + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $enable_xfer_presets_list[$o] = $row[2]; + $o++; + } - $o=0; - $k=0; - while ($campaigns_to_print > $o) + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if ($enable_xfer_presets_list[$o] == 'ENABLED') { - if ($enable_xfer_presets_list[$o] == 'ENABLED') + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; - echo ""; - echo ""; - echo "\n"; - - $k++; + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; } - $o++; + if ($p<1) + {echo "NONE";} + echo ""; + echo "\n"; + + $k++; } + $o++; + } echo "
MODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' order by preset_name;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) { - if (eregi("1$|3$|5$|7$|9$", $k)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' order by preset_name;"; - $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) - { - $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; - } - if ($p<1) - {echo "NONE";} - echo "MODIFY PRESETS
MODIFY PRESETS
\n"; } +###################### +# ADD=302 display campaign areacode cid counts +###################### +if ($ADD==302) + { + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; diff --git a/www/vicidial/admin_header.php b/www/vicidial/admin_header.php index f98c7423..ee09deea 100644 --- a/www/vicidial/admin_header.php +++ b/www/vicidial/admin_header.php @@ -31,6 +31,7 @@ # 110215-1720 - Added the Add a new lead link # 110322-1228 - Added user ID logged in as next to Logout link # 110624-1439 - Added Screen Labels sub-section to Admin +# 110831-2048 - Added AC-CID to campaign submenu # @@ -1102,6 +1103,8 @@ $SScustom_fields_enabled = $row[3]; else {$listmix_sh=''; $listmix_fc='BLACK';} if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} else {$preset_sh=''; $preset_fc='BLACK';} + if ($sh=='accid') {$accid_sh="bgcolor=\"$subcamp_color\""; $accid_fc="$subcamp_font";} + else {$accid_sh=''; $accid_fc='BLACK';} ?> > @@ -1127,7 +1130,15 @@ $SScustom_fields_enabled = $row[3]; > - 0) + { + ?> + > + +
\n"; + echo ""; + + echo "
CAMPAIGN AREACODE CID LISTINGS:\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name,use_custom_cid from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $use_custom_cid_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + $o++; + } + + echo "
CAMPAIGNNAMECUSTOM CIDAC-CIDSMODIFY
$campaigns_id_list[$o] $campaigns_name_list[$o] $use_custom_cid_list[$o] "; + + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$campaigns_id_list[$o]';"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + echo "MODIFY AC-CIDS
\n"; + } + + ###################### # ADD=311 modify list info in the system @@ -27200,7 +27516,7 @@ if ($ADD==311111111111111) $row=mysql_fetch_row($rslt); $vicidial_nanpa_prefix_codes_count = $row[0]; - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -27303,6 +27619,7 @@ if ($ADD==311111111111111) $alt_log_pass = $row[97]; $tables_use_alt_log_db = $row[98]; $did_agent_log = $row[99]; + $campaign_cid_areacodes_enabled = $row[100]; echo "
MODIFY VICIDIAL SYSTEM SETTINGS
\n"; echo "\n"; @@ -27472,6 +27789,8 @@ if ($ADD==311111111111111) echo "
Enable Campaign Test Calls: $NWB#settings-test_campaign_calls$NWE
Enable Campaign Areacode CID: $NWB#settings-campaign_cid_areacodes_enabled$NWE
First Login Trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
Default Phone Registration Password: $NWB#settings-default_phone_registration_password$NWE     Strength:
>   SIZE=>Pause Codes
>   SIZE=>Presets
>   SIZE=>AC-CID