diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 28351e05..5e22bb38 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -162,6 +162,9 @@ OTHER CHANGES: 38. Added prompt options for in-group VIDPROMPT methods when initiated from Call Menus +39. Added web-configurable TTS voice option. Please make sure the Cepstral voice + is installed before entering one. + diff --git a/agc_2-X/trunk/agi/VD_amd.agi b/agc_2-X/trunk/agi/VD_amd.agi index 691af86f..802f466c 100644 --- a/agc_2-X/trunk/agi/VD_amd.agi +++ b/agc_2-X/trunk/agi/VD_amd.agi @@ -110,8 +110,7 @@ $stmtA = "SELECT agi_output FROM servers where server_ip = '$VARserver_ip';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; -$rec_count=0; -while ($sthArows > $rec_count) +if ($sthArows > 0) { $AGILOG = '0'; @aryA = $sthA->fetchrow_array; @@ -119,7 +118,6 @@ while ($sthArows > $rec_count) if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';} if ($DBagi_output =~ /FILE/) {$AGILOG = '2';} if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';} - $rec_count++; } $sthA->finish(); @@ -491,14 +489,15 @@ else } $sthA->finish(); - $stmtA = "SELECT tts_text FROM vicidial_tts_prompts where tts_id='$TTS_filename';"; + $stmtA = "SELECT tts_text,tts_voice FROM vicidial_tts_prompts where tts_id='$TTS_filename';"; $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; - $TTS_text = $aryA[0]; + $TTS_voice = $aryA[1]; + $TTS_text = $aryA[0]; $TTS_text =~ s/--A--lead_id--B--/$TTS_lead_id/gi; $TTS_text =~ s/--A--entry_date--B--/$TTS_entry_date/gi; $TTS_text =~ s/--A--modify_date--B--/$TTS_modify_date/gi; @@ -539,13 +538,13 @@ else $TTS_text =~ s/\>/\\>/gi; $TTS_text =~ s/\//\\\//gi; $TTS_text =~ s/\'/\\'/gi; - $voice = 'Allison-8kHz'; - print STDERR "\nGenerating: $TTS_text - $voice\n"; - `$PATHagi/cepstral_generate.pl --debug --voice=$voice --dialog=$TTS_text >> $CEPLOGfile `; + # $voice = 'Allison-8kHz'; + print STDERR "\nGenerating: $TTS_text - $TTS_voice\n"; + `$PATHagi/cepstral_generate.pl --debug --voice=$TTS_voice --dialog=$TTS_text >> $CEPLOGfile `; use Digest::MD5 qw(md5_hex); - $enc = md5_hex("$TTS_textRAW-$voice"); # the hash + $enc = md5_hex("$TTS_textRAW-$TTS_voice"); # the hash $enc_ftl = substr($enc, 0, 2); # first letter of hash $TTS_filename_path = $PATHsounds . "/tts/" . $enc_ftl . "/tts-" . $enc; print STDERR "\nfilename: $TTS_filename_path\n"; 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 eca06fb9..0f8eb14b 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -521,7 +521,7 @@ if ($affected_rows > 0) $s=0; while ($s < $t) { - $stmtA = "SELECT tts_text FROM vicidial_tts_prompts where tts_id='$TTS_filename[$s]';"; + $stmtA = "SELECT tts_text,tts_voice FROM vicidial_tts_prompts where tts_id='$TTS_filename[$s]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -531,6 +531,7 @@ if ($affected_rows > 0) if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; + $TTS_voice = $aryA[1]; $TTS_text[$s] = $aryA[0]; $TTS_text[$s] =~ s/--A--lead_id--B--/$TTS_lead_id/gi; $TTS_text[$s] =~ s/--A--entry_date--B--/$TTS_entry_date/gi; @@ -572,13 +573,13 @@ if ($affected_rows > 0) $TTS_text[$s] =~ s/\>/\\>/gi; $TTS_text[$s] =~ s/\//\\\//gi; $TTS_text[$s] =~ s/\'/\\'/gi; - $voice = 'Allison-8kHz'; - print STDERR "\nGenerating: $TTS_text[$s] - $voice\n"; - `$PATHagi/cepstral_generate.pl --debug --voice=$voice --dialog=$TTS_text[$s] >> $CEPLOGfile $hideCLI`; + # $voice = 'Allison-8kHz'; + print STDERR "\nGenerating: $TTS_text[$s] - $TTS_voice\n"; + `$PATHagi/cepstral_generate.pl --debug --voice=$TTS_voice --dialog=$TTS_text[$s] >> $CEPLOGfile $hideCLI`; use Digest::MD5 qw(md5_hex); - $enc = md5_hex("$TTS_textRAW[$s]-$voice"); # the hash + $enc = md5_hex("$TTS_textRAW[$s]-$TTS_voice"); # the hash $enc_ftl = substr($enc, 0, 2); # first letter of hash $TTS_filename_path[$s] = $PATHsounds . "/tts/" . $enc_ftl . "/tts-" . $enc; print STDERR "\nfilename: $TTS_filename_path[$s]\n"; diff --git a/agc_2-X/trunk/bin/AST_VDremote_agents.pl b/agc_2-X/trunk/bin/AST_VDremote_agents.pl index fe84acb0..82132819 100644 --- a/agc_2-X/trunk/bin/AST_VDremote_agents.pl +++ b/agc_2-X/trunk/bin/AST_VDremote_agents.pl @@ -3,8 +3,6 @@ # AST_VDremote_agents.pl version 2.4 # # SUMMARY: -# This program was designed for people using the Asterisk PBX with VICIDIAL -# # To use VICIDIAL with remote agents, this must always be running # # This program must be run on each local Asterisk machine that has Remote Agents @@ -13,9 +11,6 @@ # agents that should appear to be logged in so that the calls can be transferred # out to them properly. # -# It is good practice to keep this program running by placing the associated -# KEEPALIVE script running every minute to ensure this program is always running -# # Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: @@ -39,6 +34,7 @@ # 100309-0555 - Added queuemetrics_loginout option # 100318-2307 - Added ra_user field input to vla table # 100524-1542 - Fixed live call detection bug on multi-server systems +# 100621-2152 - Added start_call_url and dispo_call_url functions for remote agents # ### begin parsing run-time options ### @@ -52,7 +48,10 @@ if (length($ARGV[0])>1) } if ($args =~ /--help/i) { - print "allowed run time options:\n [-t] = test\n [-v] = verbose debug messages\n [--delay=XXX] = delay of XXX seconds per loop, default 2 seconds\n\n"; + print "allowed run time options:\n"; + print " [-t] = test\n"; + print " [-v] = verbose debug messages\n"; + print " [--delay=XXX] = delay of XXX seconds per loop, default 2 seconds\n\n"; } else { @@ -158,8 +157,7 @@ $stmtA = "SELECT vd_server_logs,local_gmt,ext_context FROM servers where server_ $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; -$rec_count=0; -while ($sthArows > $rec_count) +if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; $DBvd_server_logs = $aryA[0]; @@ -168,7 +166,6 @@ while ($sthArows > $rec_count) if ($DBvd_server_logs =~ /Y/) {$SYSLOG = '1';} else {$SYSLOG = '0';} if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - $rec_count++; } $sthA->finish(); @@ -199,14 +196,12 @@ while($one_day_interval > 0) $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; $DBvd_server_logs = $aryA[0]; if ($DBvd_server_logs =~ /Y/) {$SYSLOG = '1';} else {$SYSLOG = '0';} - $rec_count++; } $sthA->finish(); 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 9bd0bfa7..b97402db 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -1652,7 +1652,8 @@ CREATE TABLE vicidial_tts_prompts ( tts_id VARCHAR(50) PRIMARY KEY NOT NULL, tts_name VARCHAR(100), active ENUM('Y','N'), -tts_text TEXT +tts_text TEXT, +tts_voice VARCHAR(100) default 'Allison-8kHz' ); CREATE TABLE vicidial_call_menu ( @@ -2249,7 +2250,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log; -UPDATE system_settings SET db_schema_version='1227',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1228',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.4.sql b/agc_2-X/trunk/extras/upgrade_2.4.sql index 2f1f28ab..1d163750 100644 --- a/agc_2-X/trunk/extras/upgrade_2.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.4.sql @@ -363,3 +363,7 @@ UPDATE system_settings SET db_schema_version='1226',db_schema_update_date=NOW(); ALTER TABLE system_settings ADD admin_web_directory VARCHAR(255) default 'vicidial'; UPDATE system_settings SET db_schema_version='1227',db_schema_update_date=NOW(); + +ALTER TABLE vicidial_tts_prompts ADD tts_voice VARCHAR(100) default 'Allison-8kHz'; + +UPDATE system_settings SET db_schema_version='1228',db_schema_update_date=NOW(); diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 383a4f20..e445dd8d 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -213,6 +213,8 @@ VID Digits|| Search Method defines how the queue will find the next agent, recommend leave this on LB. List ID is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. Campaign ID is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be ebtered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID|| Admin Web Directory|| This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes|| +TTS Voice|| +This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz|| AST_VICIDIAL_ingrouplist.php diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index aa07dae9..5cf75763 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -1287,6 +1287,8 @@ if (isset($_GET["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt elseif (isset($_POST["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt_seconds=$_POST["hold_time_option_prompt_seconds"];} if (isset($_GET["admin_web_directory"])) {$admin_web_directory=$_GET["admin_web_directory"];} elseif (isset($_POST["admin_web_directory"])) {$admin_web_directory=$_POST["admin_web_directory"];} +if (isset($_GET["tts_voice"])) {$tts_voice=$_GET["tts_voice"];} + elseif (isset($_POST["tts_voice"])) {$tts_voice=$_POST["tts_voice"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -1822,6 +1824,7 @@ if ($non_latin < 1) $friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override); $saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override); $admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory); + $tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); @@ -5387,6 +5390,10 @@ if ($ADD==99999) Active - This option allows you to set the TTS entry to active or inactive. +
+
+ TTS Voice - This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz. +
TTS Text - This is the actual Text To Speech data field that is sent to Cepstral for creation of the audio file to be played to the customer. you can use Speech Synthesis Markup Language -SSML- in this field, for example, <break time='1000ms'/> for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--. Here is a list of the available variables: lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -13886,7 +13893,7 @@ if ($ADD==451111111111) {echo "
TTS ENTRY NOT MODIFIED - Please go back and look at the data you entered\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_voice='$tts_voice',tts_text=\"$tts_text\" where tts_id='$tts_id';"; $rslt=mysql_query($stmt, $link); echo "
TTS ENTRY MODIFIED: $tts_id\n"; @@ -23114,13 +23121,14 @@ if ($ADD==351111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -25216,7 +25225,7 @@ if ($ADD==150000000000) echo "
\n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts where tts_id='$tts_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; + $tts_voice = $row[4]; echo "
MODIFY A TTS RECORD: $tts_id
\n"; echo "\n"; @@ -23130,6 +23138,7 @@ if ($ADD==351111111111) echo "
TTS ID: $tts_id
TTS Name: $NWB#vicidial_tts_prompts-tts_name$NWE
Active: $NWB#vicidial_tts_prompts-active$NWE
TTS Voice: $NWB#vicidial_tts_prompts-tts_voice$NWE
TTS Text: $NWB#vicidial_tts_prompts-tts_text$NWE
"; echo ""; echo ""; + echo ""; echo ""; echo "\n"; @@ -25244,6 +25254,7 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo "\n"; $o++;
\n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts order by tts_id"; $rslt=mysql_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -25226,6 +25235,7 @@ if ($ADD==150000000000) echo "TTS IDTTS NameActiveTTS VoiceTTS TextMODIFY
$row[0]$row[1]$row[2]$row[4]$row[3]MODIFY