diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index 0ef51fb0..72f8254c 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -216,6 +216,7 @@ # 170903-0929 - Added additional xfer_log details # 170914-1634 - Added Asterisk 13 compatibility # 170921-2008 - Fix for CALLID in beginning of recording filename +# 170930-0913 - Added extension append options # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -3852,19 +3853,27 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override { if ($extension_appended_cidname =~ /Y/) { - $eac_cbc=0; - $stmtA = "SELECT extension FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; + $eac_extension=''; + $stmtA = "SELECT extension,campaign_id FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; $dbhP=$dbhA; $mysql_count='02149'; $MEL_aff_rows=$sthArows; &mysql_error_logging; - while ($sthArows > $eac_cbc) + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $eac_extension = $aryA[0]; - $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; - $eac_cbc++; + if ($extension_appended_cidname =~ /USER/) + { + $eac_extension = $VDADuser; + } + else + { + $eac_extension = $aryA[0]; + $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; + } + if ($extension_appended_cidname =~ /WITH_CAMPAIGN/) + {$eac_extension .= " $aryA[1]";} } $sthA->finish(); diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index 9777a536..63e326e3 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -117,6 +117,7 @@ # 161102-1037 - Fixed QM partition problem # 161201-1003 - Fixed LRERR logging issue # 170921-2007 - Fix for CALLID in beginning of recording filename +# 170930-0913 - Added extension append options # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -2709,30 +2710,38 @@ while ($drop_timer <= $DROP_TIME) } ### END routing-initiated agent call recording for ALLCALLS/ALLFORCE ### } - if ($extension_appended_cidname =~ /Y/) + if ($extension_appended_cidname =~ /Y|USER/) { - $eac_cbc=0; - $stmtA = "SELECT extension FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; + $eac_extension=''; + $stmtA = "SELECT extension,campaign_id FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; $dbhP=$dbhA; $mysql_count='01068'; $MEL_aff_rows=$sthArows; &mysql_error_logging; - while ($sthArows > $eac_cbc) + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $eac_extension = $aryA[0]; - $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; - $eac_cbc++; + if ($extension_appended_cidname =~ /USER/) + { + $eac_extension = $VDADuser; + } + else + { + $eac_extension = $aryA[0]; + $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; + } + if ($extension_appended_cidname =~ /WITH_CAMPAIGN/) + {$eac_extension .= " $aryA[1]";} } $sthA->finish(); - $newcallerid = "\"$callerid $eac_extension <$phone_number>\""; + $newcallerid = "\"$callerid $eac_extension <$VDADphone>\""; $AGI->set_callerid($newcallerid); } else { - $newcallerid = "\"$callerid <$phone_number>\""; + $newcallerid = "\"$callerid <$VDADphone>\""; $AGI->set_callerid($newcallerid); } } @@ -3427,28 +3436,36 @@ while ($drop_timer <= $DROP_TIME) if ($extension_appended_cidname =~ /Y/) { - $eac_cbc=0; - $stmtA = "SELECT extension FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; + $eac_extension=''; + $stmtA = "SELECT extension,campaign_id FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; $dbhP=$dbhA; $mysql_count='01069'; $MEL_aff_rows=$sthArows; &mysql_error_logging; - while ($sthArows > $eac_cbc) + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $eac_extension = $aryA[0]; - $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; - $eac_cbc++; + if ($extension_appended_cidname =~ /USER/) + { + $eac_extension = $VDADuser; + } + else + { + $eac_extension = $aryA[0]; + $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; + } + if ($extension_appended_cidname =~ /WITH_CAMPAIGN/) + {$eac_extension .= " $aryA[1]";} } $sthA->finish(); - $newcallerid = "\"$callerid $eac_extension <$phone_number>\""; + $newcallerid = "\"$callerid $eac_extension <$VDADphone>\""; $AGI->set_callerid($newcallerid); } else { - $newcallerid = "\"$callerid <$phone_number>\""; + $newcallerid = "\"$callerid <$VDADphone>\""; $AGI->set_callerid($newcallerid); } } diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outboundBETA.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outboundBETA.agi index f71f459a..2d44b27b 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outboundBETA.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outboundBETA.agi @@ -118,6 +118,7 @@ # 161115-1359 - Forked to BETA script, added vdad_debug_logging option # 161201-1003 - Fixed LRERR logging issue # 170921-2007 - Fix for CALLID in beginning of recording filename +# 170930-0913 - Added extension append options # $script = 'agi-VDAD_ALL_outboundBETA.agi'; @@ -2819,28 +2820,36 @@ while ($drop_timer <= $DROP_TIME) } if ($extension_appended_cidname =~ /Y/) { - $eac_cbc=0; - $stmtA = "SELECT extension FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; + $eac_extension=''; + $stmtA = "SELECT extension,campaign_id FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; - $dbhP=$dbhA; $mysql_count='01068'; $MEL_aff_rows=$sthArows; &mysql_error_logging; - while ($sthArows > $eac_cbc) + $dbhP=$dbhA; $mysql_count='01069'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $eac_extension = $aryA[0]; - $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; - $eac_cbc++; + if ($extension_appended_cidname =~ /USER/) + { + $eac_extension = $VDADuser; + } + else + { + $eac_extension = $aryA[0]; + $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; + } + if ($extension_appended_cidname =~ /WITH_CAMPAIGN/) + {$eac_extension .= " $aryA[1]";} } $sthA->finish(); - $newcallerid = "\"$callerid $eac_extension <$phone_number>\""; + $newcallerid = "\"$callerid $eac_extension <$VDADphone>\""; $AGI->set_callerid($newcallerid); } else { - $newcallerid = "\"$callerid <$phone_number>\""; + $newcallerid = "\"$callerid <$VDADphone>\""; $AGI->set_callerid($newcallerid); } } @@ -3544,28 +3553,36 @@ while ($drop_timer <= $DROP_TIME) if ($extension_appended_cidname =~ /Y/) { - $eac_cbc=0; - $stmtA = "SELECT extension FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; + $eac_extension=''; + $stmtA = "SELECT extension,campaign_id FROM vicidial_live_agents where user='$VDADuser' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; $dbhP=$dbhA; $mysql_count='01069'; $MEL_aff_rows=$sthArows; &mysql_error_logging; - while ($sthArows > $eac_cbc) + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $eac_extension = $aryA[0]; - $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; - $eac_cbc++; + if ($extension_appended_cidname =~ /USER/) + { + $eac_extension = $VDADuser; + } + else + { + $eac_extension = $aryA[0]; + $eac_extension =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi; + } + if ($extension_appended_cidname =~ /WITH_CAMPAIGN/) + {$eac_extension .= " $aryA[1]";} } $sthA->finish(); - $newcallerid = "\"$callerid $eac_extension <$phone_number>\""; + $newcallerid = "\"$callerid $eac_extension <$VDADphone>\""; $AGI->set_callerid($newcallerid); } else { - $newcallerid = "\"$callerid <$phone_number>\""; + $newcallerid = "\"$callerid <$VDADphone>\""; $AGI->set_callerid($newcallerid); } } diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index fcd7ebbb..d2ac4d56 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -873,7 +873,7 @@ xferconf_e_number VARCHAR(50) default '', 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', +extension_appended_cidname ENUM('Y','N','Y_USER','Y_WITH_CAMPAIGN','Y_USER_WITH_CAMPAIGN') default 'N', scheduled_callbacks_count ENUM('LIVE','ALL_ACTIVE') default 'ALL_ACTIVE', manual_dial_override ENUM('NONE','ALLOW_ALL','DISABLE_ALL') default 'NONE', blind_monitor_warning ENUM('DISABLED','ALERT','NOTICE','AUDIO','ALERT_NOTICE','ALERT_AUDIO','NOTICE_AUDIO','ALL') default 'DISABLED', @@ -1158,7 +1158,7 @@ xferconf_c_number VARCHAR(50) default '', xferconf_d_number VARCHAR(50) default '', xferconf_e_number VARCHAR(50) default '', ignore_list_script_override ENUM('Y','N') default 'N', -extension_appended_cidname ENUM('Y','N') default 'N', +extension_appended_cidname ENUM('Y','N','Y_USER','Y_WITH_CAMPAIGN','Y_USER_WITH_CAMPAIGN') default 'N', uniqueid_status_display ENUM('DISABLED','ENABLED','ENABLED_PREFIX','ENABLED_PRESERVE') default 'DISABLED', uniqueid_status_prefix VARCHAR(50) default '', hold_time_option_minimum SMALLINT(5) default '0', @@ -3484,7 +3484,8 @@ report_name VARCHAR(100) COLLATE utf8_unicode_ci DEFAULT NULL, date_added DATETIME DEFAULT NULL, user VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL, domain VARCHAR(70) COLLATE utf8_unicode_ci DEFAULT NULL, -path_name VARCHAR(100) COLLATE utf8_unicode_ci DEFAULT NULL, +path_name TEXT COLLATE utf8_unicode_ci DEFAULT NULL, +custom_variables TEXT COLLATE utf8_unicode_ci DEFAULT NULL, date_modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_modify VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (custom_report_id), @@ -4085,4 +4086,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='1518',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1519',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index a811cfd6..b97fc627 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -393,3 +393,12 @@ UPDATE system_settings SET db_schema_version='1517',db_schema_update_date=NOW() ALTER TABLE vicidial_dnccom_scrub_log ADD flag_projdnc ENUM('','0','1') default '' AFTER flag_dnc; UPDATE system_settings SET db_schema_version='1518',db_schema_update_date=NOW() where db_schema_version < 1518; + +ALTER TABLE vicidial_campaigns MODIFY extension_appended_cidname ENUM('Y','N','Y_USER','Y_WITH_CAMPAIGN','Y_USER_WITH_CAMPAIGN') default 'N'; + +ALTER TABLE vicidial_inbound_groups MODIFY extension_appended_cidname ENUM('Y','N','Y_USER','Y_WITH_CAMPAIGN','Y_USER_WITH_CAMPAIGN') default 'N'; + +ALTER TABLE vicidial_custom_reports MODIFY path_name TEXT COLLATE utf8_unicode_ci DEFAULT NULL; +ALTER TABLE vicidial_custom_reports ADD custom_variables TEXT COLLATE utf8_unicode_ci DEFAULT NULL AFTER path_name; + +UPDATE system_settings SET db_schema_version='1519',db_schema_update_date=NOW() where db_schema_version < 1519; diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 2794c6fd..39a9baeb 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -2767,7 +2767,6 @@ if ($non_latin < 1) $agent_xfer_dial_with_customer = preg_replace('/[^NY]/','',$agent_xfer_dial_with_customer); $agent_xfer_park_customer_dial = preg_replace('/[^NY]/','',$agent_xfer_park_customer_dial); $agent_fullscreen = preg_replace('/[^NY]/','',$agent_fullscreen); - $extension_appended_cidname = preg_replace('/[^NY]/','',$extension_appended_cidname); $onhold_prompt_no_block = preg_replace('/[^NY]/','',$onhold_prompt_no_block); $hold_time_option_no_block = preg_replace('/[^NY]/','',$hold_time_option_no_block); $wait_time_option_no_block = preg_replace('/[^NY]/','',$wait_time_option_no_block); @@ -3193,6 +3192,7 @@ if ($non_latin < 1) $inbound_survey_callmenu = preg_replace('/[^-_0-9a-zA-Z]/','',$inbound_survey_callmenu); $filename_override = preg_replace('/[^-_0-9a-zA-Z]/','',$filename_override); $did_id = preg_replace('/[^-_0-9a-zA-Z]/','',$did_id); + $extension_appended_cidname = preg_replace('/[^-_0-9a-zA-Z]/','',$extension_appended_cidname); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_timeout_prompt); @@ -4182,12 +4182,13 @@ else # 170920-2153 - Added expired_lists_inactive system setting and functions # 170923-1425 - Added did_system_filter system setting and functions # 170926-1618 - Fix for Test Call function for Asterisk 13 +# 170930-0853 - Added extension_appended_cidname options and custom reports variable display # # 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-631a'; -$build = '170926-1618'; +$admin_version = '2.14-632a'; +$build = '170930-0853'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -22504,7 +22505,7 @@ if ($ADD==31) echo "
| "+key_value[0]+" | "+key_value[1]+" | "; + x++; + } + } + SpanInnerHTML+=" |