Voicemail information should only be saved in the voicemail table.

This commit is contained in:
Mark Crane
2013-09-28 20:55:25 +00:00
parent 07fac85b21
commit 8ebfbdba15
4 changed files with 49 additions and 47 deletions

View File

@@ -131,14 +131,14 @@
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'mailbox';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_password';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
//$apps[$x]['db'][$y]['fields'][$z]['name'] = 'mailbox';
//$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
//$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
//$z++;
//$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_password';
//$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
//$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
//$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'accountcode';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
@@ -183,21 +183,21 @@
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_enabled';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_mailto';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_attach_file';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_keep_local_after_email';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
//$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_enabled';
//$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
//$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
//$z++;
//$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_mailto';
//$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
//$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
//$z++;
//$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_attach_file';
//$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
//$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
//$z++;
//$apps[$x]['db'][$y]['fields'][$z]['name'] = 'vm_keep_local_after_email';
//$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
//$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'user_context';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';

View File

@@ -293,7 +293,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "extension, ";
$sql .= "number_alias, ";
$sql .= "password, ";
$sql .= "vm_password, ";
//$sql .= "vm_password, ";
$sql .= "accountcode, ";
$sql .= "effective_caller_id_name, ";
$sql .= "effective_caller_id_number, ";
@@ -305,10 +305,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "directory_exten_visible, ";
$sql .= "limit_max, ";
$sql .= "limit_destination, ";
$sql .= "vm_enabled, ";
$sql .= "vm_mailto, ";
$sql .= "vm_attach_file, ";
$sql .= "vm_keep_local_after_email, ";
//$sql .= "vm_enabled, ";
//$sql .= "vm_mailto, ";
//$sql .= "vm_attach_file, ";
//$sql .= "vm_keep_local_after_email, ";
$sql .= "user_context, ";
if (permission_exists('extension_toll')) {
$sql .= "toll_allow, ";
@@ -342,7 +342,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "'$extension', ";
$sql .= "'$number_alias', ";
$sql .= "'$password', ";
$sql .= "'user-choose', ";
//$sql .= "'user-choose', ";
$sql .= "'$accountcode', ";
$sql .= "'$effective_caller_id_name', ";
$sql .= "'$effective_caller_id_number', ";
@@ -354,10 +354,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "'$directory_exten_visible', ";
$sql .= "'$limit_max', ";
$sql .= "'$limit_destination', ";
$sql .= "'$vm_enabled', ";
$sql .= "'$vm_mailto', ";
$sql .= "'$vm_attach_file', ";
$sql .= "'$vm_keep_local_after_email', ";
//$sql .= "'$vm_enabled', ";
//$sql .= "'$vm_mailto', ";
//$sql .= "'$vm_attach_file', ";
//$sql .= "'$vm_keep_local_after_email', ";
$sql .= "'$user_context', ";
if (permission_exists('extension_toll')) {
$sql .= "'$toll_allow', ";
@@ -436,7 +436,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "extension = '$extension', ";
$sql .= "number_alias = '$number_alias', ";
$sql .= "password = '$password', ";
$sql .= "vm_password = '$vm_password', ";
//$sql .= "vm_password = '$vm_password', ";
$sql .= "accountcode = '$accountcode', ";
$sql .= "effective_caller_id_name = '$effective_caller_id_name', ";
$sql .= "effective_caller_id_number = '$effective_caller_id_number', ";
@@ -448,10 +448,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "directory_exten_visible = '$directory_exten_visible', ";
$sql .= "limit_max = '$limit_max', ";
$sql .= "limit_destination = '$limit_destination', ";
$sql .= "vm_enabled = '$vm_enabled', ";
$sql .= "vm_mailto = '$vm_mailto', ";
$sql .= "vm_attach_file = '$vm_attach_file', ";
$sql .= "vm_keep_local_after_email = '$vm_keep_local_after_email', ";
//$sql .= "vm_enabled = '$vm_enabled', ";
//$sql .= "vm_mailto = '$vm_mailto', ";
//$sql .= "vm_attach_file = '$vm_attach_file', ";
//$sql .= "vm_keep_local_after_email = '$vm_keep_local_after_email', ";
$sql .= "user_context = '$user_context', ";
if (permission_exists('extension_toll')) {
$sql .= "toll_allow = '$toll_allow', ";
@@ -531,7 +531,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//delete extension from memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_cmd = "memcache delete directory:".$extension."@".$_SESSION['domain_name'];
$switch_cmd = "memcache delete directory:".$extension."@".$user_context;
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
}

View File

@@ -117,7 +117,7 @@ require_once "resources/paging.php";
echo "<tr>\n";
echo th_order_by('extension', $text['label-extension'], $order_by, $order);
echo th_order_by('call_group', $text['label-call_group'], $order_by, $order);
echo th_order_by('vm_mailto', $text['label-vm_mailto'], $order_by, $order);
//echo th_order_by('vm_mailto', $text['label-vm_mailto'], $order_by, $order);
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order);
echo th_order_by('description', $text['label-description'], $order_by, $order);
echo "<td align='right' width='42'>\n";
@@ -132,7 +132,7 @@ require_once "resources/paging.php";
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['extension']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_group']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['vm_mailto']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['vm_mailto']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['enabled']."</td>\n";
echo " <td valign='top' class='row_stylebg' width='30%'>".$row['description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Copyright (C) 2010
Copyright (C) 2010 - 2013
All Rights Reserved.
Contributor(s):
@@ -198,8 +198,8 @@
}
$call_timeout = $row['call_timeout'];
$user_context = $row['user_context'];
$vm_password = $row['vm_password'];
$vm_password = str_replace("#", "", $vm_password); //preserves leading zeros
//$vm_password = $row['vm_password'];
//$vm_password = str_replace("#", "", $vm_password); //preserves leading zeros
//echo "enabled: ".$row['enabled'];
if ($row['enabled'] != "false") {
@@ -225,6 +225,7 @@
$xml .= " <user id=\"".$row['extension']."\"".$cidr."".$number_alias.">\n";
$xml .= " <params>\n";
$xml .= " <param name=\"password\" value=\"" . $row['password'] . "\"/>\n";
/*
$xml .= " <param name=\"vm-password\" value=\"" . $vm_password . "\"/>\n";
switch ($row['vm_enabled']) {
case "true":
@@ -261,6 +262,7 @@
}
$xml .= " <param name=\"vm-mailto\" value=\"" . $row['vm_mailto'] . "\"/>\n";
}
*/
if (strlen($row['mwi_account']) > 0) {
$xml .= " <param name=\"MWI-Account\" value=\"" . $row['mwi_account'] . "\"/>\n";
}
@@ -357,7 +359,7 @@
unset ($prep_statement);
//prepare extension
$extension_dir_path = realpath($_SESSION['switch']['extensions']['dir']);
$extension_dir = realpath($_SESSION['switch']['extensions']['dir']);
$user_context = str_replace(" ", "_", $user_context);
$user_context = preg_replace("/[\*\:\\/\<\>\|\'\"\?]/", "", $user_context);
@@ -439,8 +441,8 @@
$xml .= "</include>";
//write the xml file
if (is_readable($extension_dir_path) && strlen($extension_dir_path) > 0) {
$fout = fopen($extension_dir_path."/".$user_context.".xml","w");
if (is_readable($extension_dir) && strlen($extension_dir) > 0) {
$fout = fopen($extension_dir."/".$user_context.".xml","w");
fwrite($fout, $xml);
unset($xml);
fclose($fout);