diff --git a/UPGRADE b/UPGRADE
index a7038014..58afb566 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -648,6 +648,11 @@ OTHER CHANGES:
147. Added HIDEBLOB field type for custom list fields
+148. Added options to set the voicemail zone and extra voicemail options for
+ each voicemail box in phones and extra voicemail boxes. Also added
+ default voicemail zone and timezone settings in the system settings.
+ ** **** NOTE **** You might want to add the new zones in the new
+ ** voicemail.conf.sample file to your voicemail.conf file
diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl
index 6d5a66c4..a46c36ff 100644
--- a/bin/ADMIN_keepalive_ALL.pl
+++ b/bin/ADMIN_keepalive_ALL.pl
@@ -62,6 +62,7 @@
# 110512-2112 - Added vicidial_campaign_stats_debug to table cleaning
# 110525-2334 - Added cm.agi optional logging to call menus
# 110705-2023 - Added agents_calls_reset option
+# 110725-2356 - Added new voicemail time zone option and menu gather
#
$DB=0; # Debug flag
@@ -886,7 +887,7 @@ if ($timeclock_end_of_day_NOW > 0)
################################################################################
##### Get the settings from system_settings #####
-$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten FROM system_settings;";
+$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone FROM system_settings;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -899,6 +900,8 @@ if ($sthArows > 0)
$SScustom_dialplan_entry = $aryA[2];
$SSdefault_codecs = $aryA[3];
$SSgenerate_cross_server_exten = $aryA[4];
+ $SSvoicemail_timezones = $aryA[5];
+ $SSdefault_voicemail_timezone = $aryA[6];
}
$sthA->finish();
if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";}
@@ -913,6 +916,7 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
$vmCMP = compare("/etc/asterisk/BUILDvoicemail-vicidial.conf","/etc/asterisk/voicemail.conf");
if ($vmCMP > 0)
{
+ if ($DB) {print "starting voicemail configuration check\n";}
################################################################################
##### START Parsing of the voicemail.conf file
################################################################################
@@ -924,22 +928,49 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
close(vmc);
$i=0;
$vm_header_content='';
+ $vm_zones_content='';
$boxes=9999999;
+ $zones=9999;
+ $zonesend=9999;
$otherboxes=9999999;
foreach(@vmc)
{
$line = $vmc[$i];
$line =~ s/\n|\r//gi;
+ if ( ($zones > 0) && ($i > $zones) && ($line =~ /\[/) )
+ {
+ $zonesend = $i;
+ if ($DBXXX > 0) {print "voicemail zones end: $zonesend\n";}
+ }
+ if ($line =~ /\[zonemessages\]/)
+ {
+ $zones = $i;
+ if ($DBXXX > 0) {print "voicemail zones begin: $zones\n";}
+ }
if ($line =~ /\[default\]/)
{$boxes = $i;}
if ($line =~ /^; Other Voicemail Entries/)
{$otherboxes = $i;}
- ### parse through voicemail boxes and update DB with any changed settings
+ ### BEGIN parse through voicemail zonemessages
+ if ( ($i > $zones) && ($i < $zonesend) )
+ {
+ if ( ($line !~ /^;/) && (length($line) > 5) )
+ {
+ $templine = $line;
+ $templine =~ s/\|.*//gi;
+ $vm_zones_content .= "$templine\n";
+ if ($DBXXX > 0) {print "voicemail zones content: $line\n";}
+ }
+ }
+ ### END parse through voicemail zonemessages
+
+ ### BEGIN parse through voicemail boxes and update DB with any changed settings
if ($i > $boxes)
{
if ( ($line !~ /^;/) && (length($line) > 5) )
{
# 102 => 102,102a Mailbox,test@vicidial.com,,|delete=yes
+ chomp($line);
@parse_line = split(/ => /,$line);
$mailbox = $parse_line[0];
$mboptions = $parse_line[1];
@@ -947,13 +978,23 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
$vmc_pass = $options_line[0];
$vmc_email = $options_line[2];
$vmc_delete_vm_after_email='N';
+ $vmc_voicemail_timezone="$SSdefault_voicemail_timezone";
+ $vmc_voicemail_options='';
if ($mboptions =~ /delete=yes/)
{$vmc_delete_vm_after_email='Y';}
+ if ($mboptions =~ /tz=/)
+ {
+ @options_sgmt = split(/tz=/,$mboptions);
+ @tz_sgmt = split(/\|/,$options_sgmt[1]);
+ $vmc_voicemail_timezone = $tz_sgmt[0];
+ @options_sgmt = split(/tz=$vmc_voicemail_timezone\|/,$mboptions);
+ $vmc_voicemail_options = $options_sgmt[1];
+ }
$sthArows=0;
if ($i < $otherboxes)
{
- $stmtA = "SELECT voicemail_id,pass,email,delete_vm_after_email FROM phones where voicemail_id='$mailbox' and active='Y' order by extension limit 1;";
+ $stmtA = "SELECT voicemail_id,pass,email,delete_vm_after_email,voicemail_timezone,voicemail_options FROM phones where voicemail_id='$mailbox' and active='Y' order by extension limit 1;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -965,13 +1006,15 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
$mb_pass = $aryA[1];
$mb_email = $aryA[2];
$mb_delete_vm_after_email = $aryA[3];
+ $mb_voicemail_timezone = $aryA[4];
+ $mb_voicemail_options = $aryA[5];
- if ( ( ($mb_pass !~ /$vmc_pass/) || (length($mb_pass) != length($vmc_pass)) ) || ( ($mb_email !~ /$vmc_email/) || (length($mb_email) != length($vmc_email)) ) || ( ($mb_delete_vm_after_email !~ /$vmc_delete_vm_after_email/) || (length($mb_delete_vm_after_email) != length($vmc_delete_vm_after_email)) ) )
+ if ( ( ($mb_pass !~ /$vmc_pass/) || (length($mb_pass) != length($vmc_pass)) ) || ( ($mb_email !~ /$vmc_email/) || (length($mb_email) != length($vmc_email)) ) || ( ($mb_delete_vm_after_email !~ /$vmc_delete_vm_after_email/) || (length($mb_delete_vm_after_email) != length($vmc_delete_vm_after_email)) ) || ( ($mb_voicemail_timezone !~ /$vmc_voicemail_timezone/) || (length($mb_voicemail_timezone) != length($vmc_voicemail_timezone)) ) || ( ($mb_voicemail_options !~ /$vmc_voicemail_options/) || (length($mb_voicemail_options) != length($vmc_voicemail_options)) ) )
{
- $stmtA="UPDATE phones SET pass='$vmc_pass',email='$vmc_email',delete_vm_after_email='$vmc_delete_vm_after_email' where voicemail_id='$mailbox' and active='Y' order by extension limit 1;";
+ $stmtA="UPDATE phones SET pass='$vmc_pass',email='$vmc_email',delete_vm_after_email='$vmc_delete_vm_after_email',voicemail_timezone='$vmc_voicemail_timezone',voicemail_options='$vmc_voicemail_options' where voicemail_id='$mailbox' and active='Y' order by extension limit 1;";
$affected_rows = $dbhA->do($stmtA);
- $stmtA="UPDATE servers SET rebuild_conf_files='Y' where server_ip='$server_ip'";
+ $stmtA="UPDATE servers SET rebuild_conf_files='Y' where server_ip='$server_ip';";
$affected_rows = $dbhA->do($stmtA);
}
}
@@ -979,7 +1022,7 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
}
else
{
- $stmtA = "SELECT voicemail_id,pass,email,delete_vm_after_email FROM vicidial_voicemail WHERE voicemail_id='$mailbox' and active='Y' limit 1;";
+ $stmtA = "SELECT voicemail_id,pass,email,delete_vm_after_email,voicemail_timezone,voicemail_options FROM vicidial_voicemail WHERE voicemail_id='$mailbox' and active='Y' limit 1;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -991,13 +1034,15 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
$mb_pass = $aryA[1];
$mb_email = $aryA[2];
$mb_delete_vm_after_email = $aryA[3];
+ $mb_voicemail_timezone = $aryA[4];
+ $mb_voicemail_options = $aryA[5];
- if ( ( ($mb_pass !~ /$vmc_pass/) || (length($mb_pass) != length($vmc_pass)) ) || ( ($mb_email !~ /$vmc_email/) || (length($mb_email) != length($vmc_email)) ) || ( ($mb_delete_vm_after_email !~ /$vmc_delete_vm_after_email/) || (length($mb_delete_vm_after_email) != length($vmc_delete_vm_after_email)) ) )
+ if ( ( ($mb_pass !~ /$vmc_pass/) || (length($mb_pass) != length($vmc_pass)) ) || ( ($mb_email !~ /$vmc_email/) || (length($mb_email) != length($vmc_email)) ) || ( ($mb_delete_vm_after_email !~ /$vmc_delete_vm_after_email/) || (length($mb_delete_vm_after_email) != length($vmc_delete_vm_after_email)) ) || ( ($mb_voicemail_timezone !~ /$vmc_voicemail_timezone/) || (length($mb_voicemail_timezone) != length($vmc_voicemail_timezone)) ) || ( ($mb_voicemail_options !~ /$vmc_voicemail_options/) || (length($mb_voicemail_options) != length($vmc_voicemail_options)) ) )
{
- $stmtA="UPDATE vicidial_voicemail SET pass='$vmc_pass',email='$vmc_email',delete_vm_after_email='$vmc_delete_vm_after_email' where voicemail_id='$mailbox' and active='Y' limit 1;";
+ $stmtA="UPDATE vicidial_voicemail SET pass='$vmc_pass',email='$vmc_email',delete_vm_after_email='$vmc_delete_vm_after_email',voicemail_timezone='$vmc_voicemail_timezone',voicemail_options='$vmc_voicemail_options' where voicemail_id='$mailbox' and active='Y' limit 1;";
$affected_rows = $dbhA->do($stmtA);
- $stmtA="UPDATE servers SET rebuild_conf_files='Y' where server_ip='$server_ip'";
+ $stmtA="UPDATE servers SET rebuild_conf_files='Y' where server_ip='$server_ip';";
$affected_rows = $dbhA->do($stmtA);
}
}
@@ -1005,9 +1050,10 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
}
if ($sthArows < 1)
{
- if ($DB) {print "Mailbox not found: $mailbox it will be removed from voicemail.conf";}
+ if ($DB) {print "Mailbox not found: $mailbox it will be removed from voicemail.conf\n";}
}
}
+ ### END parse through voicemail boxes and update DB with any changed settings
}
else
{
@@ -1015,6 +1061,12 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se
}
$i++;
}
+ if (length($SSvoicemail_timezones) != length($vm_zones_content))
+ {
+ $stmtA="UPDATE system_settings SET voicemail_timezones='$vm_zones_content';";
+ $affected_rows = $dbhA->do($stmtA);
+ if ($DB) {print "voicemail zones updated\n";}
+ }
################################################################################
##### END Parsing of the voicemail.conf file
################################################################################
@@ -1370,7 +1422,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
##### BEGIN Generate the IAX phone entries #####
- $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,codecs_list,codecs_with_template FROM phones where server_ip='$server_ip' and protocol='IAX2' and active='Y' order by extension;";
+ $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,codecs_list,codecs_with_template,voicemail_timezone,voicemail_options FROM phones where server_ip='$server_ip' and protocol='IAX2' and active='Y' order by extension;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -1396,6 +1448,8 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$delete_vm_after_email[$i] = $aryA[14];
$codecs_list[$i] = $aryA[15];
$codecs_with_template[$i] = $aryA[16];
+ $voicemail_timezone[$i] = $aryA[17];
+ $voicemail_options[$i] = $aryA[18];
if ( (length($SSdefault_codecs) > 2) && (length($codecs_list[$i]) < 3) )
{$codecs_list[$i] = $SSdefault_codecs;}
$active_dialplan_numbers .= "'$aryA[1]',";
@@ -1478,9 +1532,9 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n";
if ($delete_vm_after_email[$i] =~ /Y/)
- {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes\n";}
+ {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
else
- {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n";}
+ {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=no|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
$i++;
}
@@ -1489,7 +1543,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
##### BEGIN Generate the SIP phone entries #####
- $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,codecs_list,codecs_with_template FROM phones where server_ip='$server_ip' and protocol='SIP' and active='Y' order by extension;";
+ $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,codecs_list,codecs_with_template,voicemail_timezone,voicemail_options FROM phones where server_ip='$server_ip' and protocol='SIP' and active='Y' order by extension;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -1515,6 +1569,8 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$delete_vm_after_email[$i] = $aryA[14];
$codecs_list[$i] = $aryA[15];
$codecs_with_template[$i] = $aryA[16];
+ $voicemail_timezone[$i] = $aryA[17];
+ $voicemail_options[$i] = $aryA[18];
if ( (length($SSdefault_codecs) > 2) && (length($codecs_list[$i]) < 3) )
{$codecs_list[$i] = $SSdefault_codecs;}
$active_dialplan_numbers .= "'$aryA[1]',";
@@ -1595,9 +1651,9 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n";
if ($delete_vm_after_email[$i] =~ /Y/)
- {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes\n";}
+ {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
else
- {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n";}
+ {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=no|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
$i++;
}
@@ -2055,7 +2111,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
while ($sthArows > $i)
{
@aryA = $sthA->fetchrow_array;
- $voicemail[$i] = "$aryA[0]";
+ $voicemail[$i] = $aryA[0];
$i++;
}
$sthA->finish();
@@ -2064,7 +2120,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
while ($sthArows > $i)
{
##### Get the distinct phone entries #####
- $stmtA = "SELECT extension,pass,email,delete_vm_after_email FROM phones where active='Y' and voicemail_id='$voicemail[$i]';";
+ $stmtA = "SELECT extension,pass,email,delete_vm_after_email,voicemail_timezone,voicemail_options FROM phones where active='Y' and voicemail_id='$voicemail[$i]';";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -2076,19 +2132,21 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$pass[$i] = $aryA[1];
$email[$i] = $aryA[2];
$delete_vm_after_email[$i] = $aryA[3];
+ $voicemail_timezone[$i] = $aryA[4];
+ $voicemail_options[$i] = $aryA[5];
+
+ if ($delete_vm_after_email[$i] =~ /Y/)
+ {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
+ else
+ {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=no|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
}
$sthA->finish();
- if ($delete_vm_after_email[$i] =~ /Y/)
- {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes\n";}
- else
- {$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i]\n";}
-
$i++;
}
##### Get the other voicemail box entries #####
- $stmtA = "SELECT voicemail_id,fullname,pass,email,delete_vm_after_email FROM vicidial_voicemail where active='Y';";
+ $stmtA = "SELECT voicemail_id,fullname,pass,email,delete_vm_after_email,voicemail_timezone,voicemail_options FROM vicidial_voicemail where active='Y';";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -2107,11 +2165,13 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$pass[$i] = $aryA[2];
$email[$i] = $aryA[3];
$delete_vm_after_email[$i] = $aryA[4];
+ $voicemail_timezone[$i] = $aryA[5];
+ $voicemail_options[$i] = $aryA[6];
if ($delete_vm_after_email[$i] =~ /Y/)
- {$vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i],,|delete=yes\n";}
+ {$vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i],,|delete=yes|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
else
- {$vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i]\n";}
+ {$vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i],,|delete=no|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
$i++;
}
diff --git a/docs/conf_examples/voicemail.conf.sample b/docs/conf_examples/voicemail.conf.sample
index 87dbd25b..dc48c6a1 100644
--- a/docs/conf_examples/voicemail.conf.sample
+++ b/docs/conf_examples/voicemail.conf.sample
@@ -11,12 +11,47 @@ skipms=3000
maxsilence=10
silencethreshold=128
maxlogins=3
-maxmsg=300
+maxmsg=500
[zonemessages]
+newzealand=Pacific/Auckland|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+australiaeast=Australia/Sydney|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+australiacentral=Australia/Adelaide|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+australiawest=Australia/Perth|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+japan=Asia/Tokyo|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+philippines=Asia/Manila|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+china=Asia/Shanghai|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+malaysia=Asia/Kuala_Lumpur|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+thailand=Asia/Bangkok|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+india=Asia/Calcutta|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+pakistan=Asia/Karachi|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+russiaeast=Europe/Moscow|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+kenya=Africa/Nairobi|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+europeaneast=Europe/Kiev|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+southafrica=Africa/Johannesburg|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+european=Europe/Copenhagen|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+nigeria=Africa/Lagos|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+uk=Europe/London|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+brazil=America/Sao_Paulo|'vm-received' Q 'digits/at' IMp
+newfoundland=Canada/Newfoundland|'vm-received' Q 'digits/at' IMp
+carribeaneast=America/Santo_Domingo|'vm-received' Q 'digits/at' IMp
+atlantic=Canada/Atlantic|'vm-received' Q 'digits/at' IMp
+chile=America/Santiago|'vm-received' Q 'digits/at' IMp
eastern=America/New_York|'vm-received' Q 'digits/at' IMp
+peru=America/Lima|'vm-received' Q 'digits/at' IMp
central=America/Chicago|'vm-received' Q 'digits/at' IMp
+mexicocity=America/Mexico_City|'vm-received' Q 'digits/at' IMp
+mountain=America/Denver|'vm-received' Q 'digits/at' IMp
+arizona=America/Phoenix|'vm-received' Q 'digits/at' IMp
+saskatchewan=America/Saskatchewan|'vm-received' Q 'digits/at' IMp
+pacific=America/Los_Angeles|'vm-received' Q 'digits/at' IMp
+alaska=America/Anchorage|'vm-received' Q 'digits/at' IMp
+hawaii=Pacific/Honolulu|'vm-received' Q 'digits/at' IMp
+eastern24=America/New_York|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
central24=America/Chicago|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+mountain24=America/Denver|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+pacific24=America/Los_Angeles|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
+military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
[default]
; mailboxes go here
diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql
index 31d55dd0..0f28a261 100644
--- a/extras/MySQL_AST_CREATE_tables.sql
+++ b/extras/MySQL_AST_CREATE_tables.sql
@@ -80,6 +80,8 @@ codecs_with_template ENUM('0','1') default '0',
webphone_dialpad ENUM('Y','N','TOGGLE','TOGGLE_OFF') default 'Y',
on_hook_agent ENUM('Y','N') default 'N',
webphone_auto_answer ENUM('Y','N') default 'Y',
+voicemail_timezone VARCHAR(30) default 'eastern',
+voicemail_options VARCHAR(255) default '',
index (server_ip),
unique index extenserver (extension, server_ip)
);
@@ -1412,7 +1414,10 @@ queuemetrics_dispo_pause VARCHAR(6) default '',
label_hide_field_logs VARCHAR(6) default 'Y',
queuemetrics_pe_phone_append ENUM('0','1') default '0',
test_campaign_calls ENUM('0','1') default '0',
-agents_calls_reset ENUM('0','1') default '1'
+agents_calls_reset ENUM('0','1') default '1',
+voicemail_timezones TEXT,
+default_voicemail_timezone VARCHAR(30) default 'eastern',
+default_local_gmt VARCHAR(6) default '-5.00'
);
CREATE TABLE vicidial_campaigns_list_mix (
@@ -2107,7 +2112,9 @@ fullname VARCHAR(100) NOT NULL,
messages INT(4) default '0',
old_messages INT(4) default '0',
email VARCHAR(100),
-delete_vm_after_email ENUM('N','Y') default 'N'
+delete_vm_after_email ENUM('N','Y') default 'N',
+voicemail_timezone VARCHAR(30) default 'eastern',
+voicemail_options VARCHAR(255) default ''
);
CREATE TABLE vicidial_user_territory_log (
@@ -2511,6 +2518,8 @@ INSERT INTO vicidial_scripts (script_id,script_name,script_comments,active,scrip
UPDATE system_settings SET qc_last_pull_time=NOW();
+UPDATE system_settings SET voicemail_timezones="newzealand=Pacific/Auckland\naustraliaeast=Australia/Sydney\naustraliacentral=Australia/Adelaide\naustraliawest=Australia/Perth\njapan=Asia/Tokyo\nphilippines=Asia/Manila\nchina=Asia/Shanghai\nmalaysia=Asia/Kuala_Lumpur\nthailand=Asia/Bangkok\nindia=Asia/Calcutta\npakistan=Asia/Karachi\nrussiaeast=Europe/Moscow\nkenya=Africa/Nairobi\neuropeaneast=Europe/Kiev\nsouthafrica=Africa/Johannesburg\neuropean=Europe/Copenhagen\nnigeria=Africa/Lagos\nuk=Europe/London\nbrazil=America/Sao_Paulo\nnewfoundland=Canada/Newfoundland\ncarribeaneast=America/Santo_Domingo\natlantic=Canada/Atlantic\nchile=America/Santiago\neastern=America/New_York\nperu=America/Lima\ncentral=America/Chicago\nmexicocity=America/Mexico_City\nmountain=America/Denver\narizona=America/Phoenix\nsaskatchewan=America/Saskatchewan\npacific=America/Los_Angeles\nalaska=America/Anchorage\nhawaii=Pacific/Honolulu\neastern24=America/New_York\ncentral24=America/Chicago\nmountain24=America/Denver\npacific24=America/Los_Angeles\nmilitary=Zulu\n";
+
CREATE INDEX country_postal_code on vicidial_postal_codes (country_code,postal_code);
CREATE INDEX country_area_code on vicidial_phone_codes (country_code,areacode);
CREATE INDEX country_state on vicidial_phone_codes (country_code,state);
@@ -2549,7 +2558,7 @@ ALTER TABLE vicidial_closer_log_archive MODIFY closecallid INT(9) UNSIGNED NOT N
CREATE TABLE vicidial_outbound_ivr_log_archive LIKE vicidial_outbound_ivr_log;
-UPDATE system_settings SET db_schema_version='1288',db_schema_update_date=NOW();
+UPDATE system_settings SET db_schema_version='1289',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 3e381de3..d645ac50 100644
--- a/extras/upgrade_2.4.sql
+++ b/extras/upgrade_2.4.sql
@@ -895,3 +895,14 @@ ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT',
UPDATE system_settings SET db_schema_version='1288',db_schema_update_date=NOW() where db_schema_version < 1288;
+ALTER TABLE vicidial_voicemail ADD voicemail_timezone VARCHAR(30) default 'eastern';
+ALTER TABLE vicidial_voicemail ADD voicemail_options VARCHAR(255) default '';
+
+ALTER TABLE phones ADD voicemail_timezone VARCHAR(30) default 'eastern';
+ALTER TABLE phones ADD voicemail_options VARCHAR(255) default '';
+
+ALTER TABLE system_settings ADD voicemail_timezones TEXT;
+ALTER TABLE system_settings ADD default_voicemail_timezone VARCHAR(30) default 'eastern';
+ALTER TABLE system_settings ADD default_local_gmt VARCHAR(6) default '-5.00';
+
+UPDATE system_settings SET db_schema_version='1289',db_schema_update_date=NOW() where db_schema_version < 1289;
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 520dd8bf..1fbf8d72 100644
--- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
+++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt
@@ -669,6 +669,15 @@ This is the phone protocol that will be used for all phones created when submitt
Local GMT||
This is the time zone that all of the phones will be created with||
HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured||
+Default Local GMT||
+This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5||
+Default Voicemail Zone||
+This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern||
+Voicemail Zone||
+This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings||
+Voicemail Options||
+This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing||
+The next two settings are also defined in the System Settings section, and you can change them after you define them here. You should set the Default Local GMT to the timezone that your agents want to be in. The Voicemail zone is the listing of voicemail timezones that voicemail messages will be time logged with when new messages are left||
lead_report_export.php
diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php
index 01162fa7..39068deb 100644
--- a/www/vicidial/admin.php
+++ b/www/vicidial/admin.php
@@ -1581,8 +1581,16 @@ if (isset($_GET["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_appe
elseif (isset($_POST["queuemetrics_pe_phone_append"])) {$queuemetrics_pe_phone_append=$_POST["queuemetrics_pe_phone_append"];}
if (isset($_GET["test_campaign_calls"])) {$test_campaign_calls=$_GET["test_campaign_calls"];}
elseif (isset($_POST["test_campaign_calls"])) {$test_campaign_calls=$_POST["test_campaign_calls"];}
-if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];}
+if (isset($_GET["agents_calls_reset"])) {$agents_calls_reset=$_GET["agents_calls_reset"];}
elseif (isset($_POST["agents_calls_reset"])) {$agents_calls_reset=$_POST["agents_calls_reset"];}
+if (isset($_GET["voicemail_timezone"])) {$voicemail_timezone=$_GET["voicemail_timezone"];}
+ elseif (isset($_POST["voicemail_timezone"])) {$voicemail_timezone=$_POST["voicemail_timezone"];}
+if (isset($_GET["voicemail_options"])) {$voicemail_options=$_GET["voicemail_options"];}
+ elseif (isset($_POST["voicemail_options"])) {$voicemail_options=$_POST["voicemail_options"];}
+if (isset($_GET["default_voicemail_timezone"])) {$default_voicemail_timezone=$_GET["default_voicemail_timezone"];}
+ elseif (isset($_POST["default_voicemail_timezone"])) {$default_voicemail_timezone=$_POST["default_voicemail_timezone"];}
+if (isset($_GET["default_local_gmt"])) {$default_local_gmt=$_GET["default_local_gmt"];}
+ elseif (isset($_POST["default_local_gmt"])) {$default_local_gmt=$_POST["default_local_gmt"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -1596,7 +1604,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 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 FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -1621,6 +1629,9 @@ if ($qm_conf_ct > 0)
$SSdefault_server_password = $row[15];
$SStest_campaign_calls = $row[16];
$SSactive_voicemail_server = $row[17];
+ $SSvoicemail_timezones = $row[18];
+ $SSdefault_voicemail_timezone = $row[19];
+ $SSdefault_local_gmt = $row[20];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -2201,6 +2212,8 @@ if ($non_latin < 1)
$label_hide_field_logs = ereg_replace("[^-_0-9a-zA-Z]","",$label_hide_field_logs);
$label_id = ereg_replace("[^-_0-9a-zA-Z]","",$label_id);
$status_display_fields = ereg_replace("[^-_0-9a-zA-Z]","",$status_display_fields);
+ $voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$voicemail_timezone);
+ $default_voicemail_timezone = ereg_replace("[^-_0-9a-zA-Z]","",$default_voicemail_timezone);
### ALPHA-NUMERIC and underscore and dash and slash and dot
$menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt);
@@ -2334,6 +2347,7 @@ if ($non_latin < 1)
$filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description);
$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);
### 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);
@@ -2365,6 +2379,9 @@ if ($non_latin < 1)
### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma
$ivr_park_call_agi = ereg_replace("[^ -\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi);
+ ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal
+ $voicemail_options = ereg_replace("[^ -\=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options);
+
### NUMERIC and comma and pipe
$waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options);
@@ -2781,12 +2798,13 @@ else
# 110703-1400 - Added test_campaign_calls and agents_calls_reset features
# 110707-0725 - Added AGENTEXT notes for in-groups settings
# 110707-1402 - Added last_inbound_call_time and finish to next agent call options for in-groups
+# 110727-0130 - Added more voicemail box options and default timezone and voicemail zone to system settings
#
# 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-324a';
-$build = '110707-1402';
+$admin_version = '2.4-325a';
+$build = '110727-0130';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -6483,8 +6501,13 @@ if ($ADD==99999)
Delete Voicemail After Email - This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N.
+
+
+ Voicemail Zone - This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings.
-
+
+
+ Voicemail Options - This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing.
0)
@@ -6552,6 +6575,14 @@ if ($ADD==99999)
Voicemail Box - This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app.
+
+
+ Voicemail Zone - This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings.
+
+
+
+ Voicemail Options - This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing.
+
@@ -7362,6 +7393,16 @@ if ($ADD==99999)
Timeclock End Of Day - This setting defines when all users are to be auto logged out of the timeclock system. Only runs once a day. must be only 4 digits 2 digit hour and 2 digit minutes in 24 hour time. Default is 0000.
+
+
+
+ Default Local GMT - This setting defines what will be used by default when new phones and servers are added using this admin web interface. Default is -5.
+
+
+
+
+ Default Voicemail Zone - This setting defines what zone will be used by default when new phones and voicemail boxes are created. The list of available zones is directly taken from the voicemail.conf file. Default is eastern.
+
@@ -9546,7 +9587,7 @@ if ($ADD==11111111111)
# echo "
\n";
echo "";
- $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,is_webphone,use_external_server_ip,codecs_list,codecs_with_template,webphone_dialpad,on_hook_agent,webphone_auto_answer from phones where extension='$extension' and server_ip='$server_ip';";
+ $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,is_webphone,use_external_server_ip,codecs_list,codecs_with_template,webphone_dialpad,on_hook_agent,webphone_auto_answer,voicemail_timezone,voicemail_options from phones where extension='$extension' and server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
@@ -25759,6 +25800,24 @@ if ($ADD==31111111111)
echo "
Full Name:
$NWB#phones-fullname$NWE
\n";
echo "
Email:
$NWB#phones-email$NWE
\n";
echo "
Delete Voicemail After Email:
$NWB#phones-delete_vm_after_email$NWE
\n";
+ echo "
Voicemail Zone:
$NWB#phones-voicemail_timezone$NWE
\n";
+ echo "
Voicemail Options:
$NWB#phones-voicemail_options$NWE
\n";
echo "
Company:
$NWB#phones-company$NWE
\n";
echo "
Picture:
$NWB#phones-picture$NWE
\n";
echo "
New Messages:
$row[14]$NWB#phones-messages$NWE
\n";
@@ -25900,15 +25959,16 @@ if ($ADD==32111111111)
echo "
\n";
echo "
LOGIN
EXTENSION
SERVER
PROTOCOL
IP
\n";
- $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');";
- if ($DB) {echo "|$stmt|";}
- $rsltx=mysql_query($stmt, $link);
- $lists_to_print = mysql_num_rows($rsltx);
+ $stmt="SELECT login,extension,server_ip,protocol,phone_ip from phones where login IN ('$phone_alias_SQL');";
+ if ($DB) {echo "|$stmt|";}
+ $rsltx=mysql_query($stmt, $link);
+ $lists_to_print = mysql_num_rows($rsltx);
- $o=0;
- while ($lists_to_print > $o) {
- $rowx=mysql_fetch_row($rsltx);
- $o++;
+ $o=0;
+ while ($lists_to_print > $o)
+ {
+ $rowx=mysql_fetch_row($rsltx);
+ $o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
@@ -26672,7 +26732,7 @@ if ($ADD==371111111111)
echo "
\n";
echo "";
- $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email from vicidial_voicemail where voicemail_id='$voicemail_id';";
+ $stmt="SELECT voicemail_id,pass,fullname,active,email,messages,old_messages,delete_vm_after_email,voicemail_timezone,voicemail_options from vicidial_voicemail where voicemail_id='$voicemail_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$voicemail_id = $row[0];
@@ -26683,6 +26743,8 @@ if ($ADD==371111111111)
$messages = $row[5];
$old_messages = $row[6];
$delete_vm_after_email = $row[7];
+ $voicemail_timezone = $row[8];
+ $voicemail_options = $row[9];
echo " MODIFY A VOICEMAIL BOX: $tts_id\n";
}