Added ability to use static audio from dynamic fields in Survey and Answering machine messages when using Cepstral TTS
Added voicemail emailbody to voicemail.conf that will show callerIDnumber after the name git-svn-id: svn://192.168.202.10@1710 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -677,6 +677,9 @@ OTHER CHANGES:
|
||||
fairly detailed and database-intensive report that summarizes several
|
||||
user-grouped statistics
|
||||
|
||||
154. Added ability to use static audio from dynamic fields in Survey and
|
||||
Answering machine messages when using Cepstral TTS
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+62
-1
@@ -40,12 +40,14 @@
|
||||
# 100903-0041 - Changed lead_id max length to 10 digits
|
||||
# 101111-1552 - Fixed minor bug in TTS filtering
|
||||
# 110324-2334 - Logging changes made
|
||||
# 110812-1515 - Added static tts file parsing and replacement
|
||||
#
|
||||
|
||||
$script = 'VD_amd.agi';
|
||||
|
||||
$A = 1; # set to 1 for AMD output messages mode
|
||||
$AMD_LOG = 1; # set to 1 for logfile
|
||||
$wav='.wav';
|
||||
|
||||
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
$year = ($year + 1900);
|
||||
@@ -515,6 +517,7 @@ else
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$TTS_voice = $aryA[1];
|
||||
$TTS_text = $aryA[0];
|
||||
### BEGIN replace variables with record values ###
|
||||
$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;
|
||||
@@ -546,6 +549,62 @@ else
|
||||
$TTS_text =~ s/--A--last_local_call_time--B--/$TTS_last_local_call_time/gi;
|
||||
$TTS_text =~ s/--A--rank--B--/$TTS_rank/gi;
|
||||
$TTS_text =~ s/--A--owner--B--/$TTS_owner/gi;
|
||||
### END replace variables with record values ###
|
||||
|
||||
### BEGIN check for --C-- and --D-- tags for static file replacement
|
||||
if ( ($TTS_text =~ /--C--/) || ($TTS_text =~ /--D--/) )
|
||||
{
|
||||
$Cdash='--C--';
|
||||
$Ddash='--D--';
|
||||
@static_check = split(/--C--/,$TTS_text);
|
||||
$sc=0;
|
||||
$sr=0;
|
||||
foreach(@static_check)
|
||||
{
|
||||
if ($sc > 0)
|
||||
{
|
||||
$static_check[$sc] =~ s/--D-.*//gi;
|
||||
$static_check_lc = lc($static_check[$sc]);
|
||||
print STDERR " Checking For Static Replacement: $static_check[$sc]|$static_check_lc$wav\n";
|
||||
$static_found=0;
|
||||
if (-e "/var/lib/asterisk/sounds/tts_static/$static_check_lc$wav")
|
||||
{
|
||||
$CDstatic = "<audio src='/var/lib/asterisk/sounds/tts_static/$static_check_lc$wav' /> ";
|
||||
$static_found++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-e "/var/lib/asterisk/sounds/$static_check_lc$wav")
|
||||
{
|
||||
$CDstatic = "<audio src='/var/lib/asterisk/sounds/$static_check_lc$wav' /> ";
|
||||
$static_found++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$firsttwo = substr($static_check_lc, 0, 2);
|
||||
if (-e "/var/lib/asterisk/sounds/tts_static/$firsttwo/$static_check_lc$wav")
|
||||
{
|
||||
$CDstatic = "<audio src='/var/lib/asterisk/sounds/tts_static/$firsttwo/$static_check_lc$wav' /> ";
|
||||
$static_found++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($static_found > 0)
|
||||
{
|
||||
$CDmatch = "$Cdash$static_check[$sc]$Ddash";
|
||||
$TTS_text =~ s/$CDmatch/$CDstatic/gi;
|
||||
print STDERR " Static Replacement Found: $CDmatch|$CDstatic\n";
|
||||
$sr++;
|
||||
}
|
||||
}
|
||||
$sc++;
|
||||
}
|
||||
$TTS_text =~ s/--C--|--D--//gi;
|
||||
print STDERR "\nStatic Replacements Found: $sc|$sr\n";
|
||||
}
|
||||
### END check for --C-- and --D-- tags for static file replacement
|
||||
|
||||
### filter input for CLI-safe characters
|
||||
$TTS_text =~ s/[^,\.\<\>\'\/\=\_\-\: 0-9a-zA-Z]//gi;
|
||||
$TTS_textRAW = $TTS_text;
|
||||
$TTS_text =~ s/ /\\ /gi;
|
||||
@@ -555,8 +614,10 @@ else
|
||||
$TTS_text =~ s/\>/\\>/gi;
|
||||
$TTS_text =~ s/\//\\\//gi;
|
||||
$TTS_text =~ s/\'/\\'/gi;
|
||||
# $voice = 'Allison-8kHz';
|
||||
# $voice = 'Allison-8kHz'; # override the voice to Allison-8k
|
||||
print STDERR "\nGenerating: $TTS_text - $TTS_voice\n";
|
||||
|
||||
### send command to generate cepstral TTS audio file
|
||||
`$PATHagi/cepstral_generate.pl --debug --voice=$TTS_voice --dialog=$TTS_text >> $CEPLOGfile `;
|
||||
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
# 110528-2326 - Added CALLMENU survey method
|
||||
# 110626-2342 - Added queuemetrics_pe_phone_append
|
||||
# 110723-2330 - Set CID to customer phone number and caller code when transferring to CALLMENU
|
||||
# 110812-1514 - Added static tts file parsing and replacement
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_outbound.agi';
|
||||
@@ -100,6 +101,7 @@ $one_mysql_log=0;
|
||||
$DROP_TIME = 9; ### default number of seconds to wait until you drop a waiting call
|
||||
$at='@';
|
||||
$US='_';
|
||||
$wav='.wav';
|
||||
|
||||
# get date/time
|
||||
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
@@ -629,6 +631,7 @@ if ($VDACaffected_rows > 0)
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$TTS_voice = $aryA[1];
|
||||
$TTS_text[$s] = $aryA[0];
|
||||
### BEGIN replace variables with record values ###
|
||||
$TTS_text[$s] =~ s/--A--lead_id--B--/$TTS_lead_id/gi;
|
||||
$TTS_text[$s] =~ s/--A--entry_date--B--/$TTS_entry_date/gi;
|
||||
$TTS_text[$s] =~ s/--A--modify_date--B--/$TTS_modify_date/gi;
|
||||
@@ -660,6 +663,62 @@ if ($VDACaffected_rows > 0)
|
||||
$TTS_text[$s] =~ s/--A--last_local_call_time--B--/$TTS_last_local_call_time/gi;
|
||||
$TTS_text[$s] =~ s/--A--rank--B--/$TTS_rank/gi;
|
||||
$TTS_text[$s] =~ s/--A--owner--B--/$TTS_owner/gi;
|
||||
### END replace variables with record values ###
|
||||
|
||||
### BEGIN check for --C-- and --D-- tags for static file replacement
|
||||
if ( ($TTS_text[$s] =~ /--C--/) || ($TTS_text[$s] =~ /--D--/) )
|
||||
{
|
||||
$Cdash='--C--';
|
||||
$Ddash='--D--';
|
||||
@static_check = split(/--C--/,$TTS_text[$s]);
|
||||
$sc=0;
|
||||
$sr=0;
|
||||
foreach(@static_check)
|
||||
{
|
||||
if ($sc > 0)
|
||||
{
|
||||
$static_check[$sc] =~ s/--D-.*//gi;
|
||||
$static_check_lc = lc($static_check[$sc]);
|
||||
print STDERR " Checking For Static Replacement: $static_check[$sc]|$static_check_lc$wav\n";
|
||||
$static_found=0;
|
||||
if (-e "/var/lib/asterisk/sounds/tts_static/$static_check_lc$wav")
|
||||
{
|
||||
$CDstatic = "<audio src='/var/lib/asterisk/sounds/tts_static/$static_check_lc$wav' /> ";
|
||||
$static_found++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-e "/var/lib/asterisk/sounds/$static_check_lc$wav")
|
||||
{
|
||||
$CDstatic = "<audio src='/var/lib/asterisk/sounds/$static_check_lc$wav' /> ";
|
||||
$static_found++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$firsttwo = substr($static_check_lc, 0, 2);
|
||||
if (-e "/var/lib/asterisk/sounds/tts_static/$firsttwo/$static_check_lc$wav")
|
||||
{
|
||||
$CDstatic = "<audio src='/var/lib/asterisk/sounds/tts_static/$firsttwo/$static_check_lc$wav' /> ";
|
||||
$static_found++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($static_found > 0)
|
||||
{
|
||||
$CDmatch = "$Cdash$static_check[$sc]$Ddash";
|
||||
$TTS_text[$s] =~ s/$CDmatch/$CDstatic/gi;
|
||||
print STDERR " Static Replacement Found: $CDmatch|$CDstatic\n";
|
||||
$sr++;
|
||||
}
|
||||
}
|
||||
$sc++;
|
||||
}
|
||||
$TTS_text[$s] =~ s/--C--|--D--//gi;
|
||||
print STDERR "\nStatic Replacements Found: $sc|$sr\n";
|
||||
}
|
||||
### END check for --C-- and --D-- tags for static file replacement
|
||||
|
||||
### filter input for CLI-safe characters
|
||||
$TTS_text[$s] =~ s/[^,\.\<\>\'\/\=\_\-\: 0-9a-zA-Z]//gi;
|
||||
$TTS_textRAW[$s] = $TTS_text[$s];
|
||||
$TTS_text[$s] =~ s/ /\\ /gi;
|
||||
@@ -669,8 +728,10 @@ if ($VDACaffected_rows > 0)
|
||||
$TTS_text[$s] =~ s/\>/\\>/gi;
|
||||
$TTS_text[$s] =~ s/\//\\\//gi;
|
||||
$TTS_text[$s] =~ s/\'/\\'/gi;
|
||||
# $voice = 'Allison-8kHz';
|
||||
# $voice = 'Allison-8kHz'; # override the voice to Allison-8k
|
||||
print STDERR "\nGenerating: $TTS_text[$s] - $TTS_voice\n";
|
||||
|
||||
### send command to generate cepstral TTS audio file
|
||||
`$PATHagi/cepstral_generate.pl --debug --voice=$TTS_voice --dialog=$TTS_text[$s] >> $CEPLOGfile $hideCLI`;
|
||||
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
@@ -12,6 +12,7 @@ maxsilence=10
|
||||
silencethreshold=128
|
||||
maxlogins=3
|
||||
maxmsg=500
|
||||
emailbody=Dear ${VM_NAME}:\n\n\tJust wanted to let you know you were just left a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CIDNAME} ${VM_CIDNUM}, on ${VM_DATE}, so you might\nwant to check it when you get a chance. Thanks!\n\n\t\t\t\t--PBX\n
|
||||
|
||||
[zonemessages]
|
||||
newzealand=Pacific/Auckland|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
# 100428-0936 - Added DB custom user/pass fields
|
||||
# 101217-0520 - Added PREPROCESS directory
|
||||
# 110619-2153 - Added languages install and conf file specify options
|
||||
# 110812-1510 - Added tts sound directories creation
|
||||
#
|
||||
|
||||
############################################
|
||||
@@ -2482,6 +2483,10 @@ if ($WEBONLY < 1)
|
||||
print "Copying sounds to $PATHsounds...\n";
|
||||
`cp -fR ./sounds/* $PATHsounds/`;
|
||||
|
||||
print "Creating sound tts directories...\n";
|
||||
if (!-e "$PATHsounds/tts/") {`mkdir -p $PATHsounds/tts/`;}
|
||||
if (!-e "$PATHsounds/tts_static/") {`mkdir -p $PATHsounds/tts_static/`;}
|
||||
|
||||
print "Copying ip_relay scripts to $PATHhome...\n";
|
||||
`cp -fR ./extras/ip_relay $PATHhome/`;
|
||||
|
||||
|
||||
@@ -12313,7 +12313,7 @@ function phone_number_format(formatphone) {
|
||||
document.getElementById("MainTable").style.backgroundColor="<?php echo $SCRIPT_COLOR ?>";
|
||||
document.getElementById("MaiNfooter").style.backgroundColor="<?php echo $SCRIPT_COLOR ?>";
|
||||
panel_bgcolor='<?php echo $SCRIPT_COLOR ?>';
|
||||
document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
|
||||
// document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
|
||||
|
||||
HidEGenDerPulldown();
|
||||
}
|
||||
@@ -12328,7 +12328,7 @@ function phone_number_format(formatphone) {
|
||||
document.getElementById("MainTable").style.backgroundColor="<?php echo $FORM_COLOR ?>";
|
||||
document.getElementById("MaiNfooter").style.backgroundColor="<?php echo $FORM_COLOR ?>";
|
||||
panel_bgcolor='<?php echo $FORM_COLOR ?>';
|
||||
document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
|
||||
// document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
|
||||
|
||||
HidEGenDerPulldown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user