Changed survey audio files to allow for multiple files with pipe delimiter

small fix for remote agent inbound routing

git-svn-id: svn://192.168.202.10@1739 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-10-10 20:20:27 +00:00
parent ad5036487b
commit c7224e22ea
5 changed files with 92 additions and 14 deletions
+78 -5
View File
@@ -954,7 +954,24 @@ if ($call_handle_method =~ /REMIND/)
$dbhP=$dbhA; $mysql_count='01013'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|REMIND|"; &agi_output;}
$AGI->stream_file("$survey_first_audio_file");
if ( $survey_first_audio_file ne "")
{
if ($survey_first_audio_file =~ /\|/)
{
@survey_first_audio_file_array = split(/\|/,$survey_first_audio_file);
$w=0;
foreach(@survey_first_audio_file_array)
{
if (length($survey_first_audio_file_array[$w])>0)
{
$AGI->stream_file("$survey_first_audio_file_array[$w]");
}
$w++;
}
}
else
{$AGI->stream_file("$survey_first_audio_file");}
}
}
@@ -1061,7 +1078,21 @@ if ($call_handle_method =~ /SURVEY/)
{
if ( $survey_ni_audio_file ne "")
{
$AGI->stream_file($survey_ni_audio_file);
if ($survey_ni_audio_file =~ /\|/)
{
@survey_ni_audio_file_array = split(/\|/,$survey_ni_audio_file);
$w=0;
foreach(@survey_ni_audio_file_array)
{
if (length($survey_ni_audio_file_array[$w])>0)
{
$AGI->stream_file("$survey_ni_audio_file_array[$w]");
}
$w++;
}
}
else
{$AGI->stream_file("$survey_ni_audio_file");}
}
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
@@ -1132,7 +1163,21 @@ if ($call_handle_method =~ /SURVEY/)
{
if ( $survey_third_audio_file ne "")
{
$AGI->stream_file($survey_third_audio_file);
if ($survey_third_audio_file =~ /\|/)
{
@survey_third_audio_file_array = split(/\|/,$survey_third_audio_file);
$w=0;
foreach(@survey_third_audio_file_array)
{
if (length($survey_third_audio_file_array[$w])>0)
{
$AGI->stream_file("$survey_third_audio_file_array[$w]");
}
$w++;
}
}
else
{$AGI->stream_file("$survey_third_audio_file");}
}
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
@@ -1215,7 +1260,21 @@ if ($call_handle_method =~ /SURVEY/)
{
if ( $survey_fourth_audio_file ne "")
{
$AGI->stream_file($survey_fourth_audio_file);
if ($survey_fourth_audio_file =~ /\|/)
{
@survey_fourth_audio_file_array = split(/\|/,$survey_fourth_audio_file);
$w=0;
foreach(@survey_fourth_audio_file_array)
{
if (length($survey_fourth_audio_file_array[$w])>0)
{
$AGI->stream_file("$survey_fourth_audio_file_array[$w]");
}
$w++;
}
}
else
{$AGI->stream_file("$survey_fourth_audio_file");}
}
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
@@ -1314,7 +1373,21 @@ if ($call_handle_method =~ /SURVEY/)
if ( $survey_opt_in_audio_file ne "")
{
$AGI->stream_file($survey_opt_in_audio_file);
if ($survey_opt_in_audio_file =~ /\|/)
{
@survey_opt_in_audio_file_array = split(/\|/,$survey_opt_in_audio_file);
$w=0;
foreach(@survey_opt_in_audio_file_array)
{
if (length($survey_opt_in_audio_file_array[$w])>0)
{
$AGI->stream_file("$survey_opt_in_audio_file_array[$w]");
}
$w++;
}
}
else
{$AGI->stream_file("$survey_opt_in_audio_file");}
}
if ($survey_method =~ /VOICEMAIL|EXTENSION|HANGUP|CALLMENU/)
+2 -2
View File
@@ -325,10 +325,10 @@ while($one_day_interval > 0)
$stmtC = "UPDATE vicidial_closer_log set status='XFER',user='$QHuser[$w]',comments='REMOTE' where lead_id='$QHlead_id[$w]' and uniqueid='$QHuniqueid[$w]' and campaign_id='$QHcampaign_id[$w]' limit 1;";
$Caffected_rows = $dbhA->do($stmtC);
$stmtD = "UPDATE vicidial_live_inbound_agents set calls_today=(calls_today + 1),last_call_time='$SQLdate' where user='$QHuser[$w]' and group_id='$QHcampaign_id[$w]';";
$stmtD = "INSERT IGNORE INTO vicidial_live_inbound_agents SET calls_today='1',last_call_time='$SQLdate' where user='$QHuser[$w]' and group_id='$QHcampaign_id[$w]' ON DUPLICATE KEY UPDATE calls_today=(calls_today + 1),last_call_time='$SQLdate';";
$Daffected_rows = $dbhA->do($stmtD);
$stmtE = "UPDATE vicidial_inbound_group_agents set calls_today=(calls_today + 1) where user='$QHuser[$w]' and group_id='$QHcampaign_id[$w]';";
$stmtE = "INSERT IGNORE INTO vicidial_inbound_group_agents set calls_today=1 where user='$QHuser[$w]' and group_id='$QHcampaign_id[$w]' ON DUPLICATE KEY UPDATE calls_today=(calls_today + 1);";
$Eaffected_rows = $dbhA->do($stmtE);
$stmtG = "SELECT start_call_url FROM vicidial_inbound_groups where group_id='$QHcampaign_id[$w]';";
+3 -2
View File
@@ -1540,7 +1540,8 @@ group_weight TINYINT(1) default '0',
calls_today SMALLINT(5) UNSIGNED default '0',
group_web_vars VARCHAR(255) default '',
index (group_id),
index (user)
index (user),
unique index viga_user_group_id (user, group_id)
);
CREATE TABLE vicidial_live_inbound_agents (
@@ -2679,7 +2680,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='1302',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1303',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+4
View File
@@ -1095,3 +1095,7 @@ ALTER TABLE system_settings ADD expanded_list_stats ENUM('0','1') default '1';
ALTER TABLE vicidial_shifts ADD report_option ENUM('Y','N') default 'N';
UPDATE system_settings SET db_schema_version='1302',db_schema_update_date=NOW() where db_schema_version < 1302;
CREATE UNIQUE INDEX viga_user_group_id on vicidial_inbound_group_agents (user, group_id);
UPDATE system_settings SET db_schema_version='1303',db_schema_update_date=NOW() where db_schema_version < 1303;
+5 -5
View File
@@ -2200,9 +2200,6 @@ if ($non_latin < 1)
$alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$alias_id);
$shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$shift_id);
$qc_shift_id = ereg_replace("[^-_0-9a-zA-Z]","",$qc_shift_id);
$survey_first_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_first_audio_file);
$survey_opt_in_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_opt_in_audio_file);
$survey_ni_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_ni_audio_file);
$survey_method = ereg_replace("[^-_0-9a-zA-Z]","",$survey_method);
$alter_custphone_override = ereg_replace("[^-_0-9a-zA-Z]","",$alter_custphone_override);
$manual_dial_filter = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_filter);
@@ -2232,8 +2229,6 @@ if ($non_latin < 1)
$group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id);
$default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias);
$vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead);
$survey_third_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_third_audio_file);
$survey_fourth_audio_file = ereg_replace("[^-_0-9a-zA-Z]","",$survey_fourth_audio_file);
$menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$menu_id);
$source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu);
$call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id);
@@ -2355,6 +2350,11 @@ if ($non_latin < 1)
$alt_log_dbname = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_dbname);
$alt_log_login = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_login);
$alt_log_pass = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$alt_log_pass);
$survey_first_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_first_audio_file);
$survey_opt_in_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_opt_in_audio_file);
$survey_ni_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_ni_audio_file);
$survey_third_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_third_audio_file);
$survey_fourth_audio_file = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$survey_fourth_audio_file);
### ALPHA-NUMERIC and underscore and dash and comma
$logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list);