| 3 | | global $astman; |
|---|
| 4 | | $extens = core_users_list(); |
|---|
| 5 | | $extension = $extdisplay = (isset($_REQUEST["extdisplay"]) && $_REQUEST["extdisplay"] != "")?$_REQUEST["extdisplay"]:$extens[0][0]; |
|---|
| 6 | | vmaildrawListMenu($extens, $type="setup", $dispnum="vmailadmin", $extdisplay, $description=false); |
|---|
| 7 | | ?> |
|---|
| 8 | | </div> |
|---|
| 9 | | <?php |
|---|
| 10 | | // For the module: |
|---|
| 11 | | $type = isset($_REQUEST["type"])?$_REQUEST["type"]:""; |
|---|
| 12 | | $display = isset($_REQUEST["display"])?$_REQUEST["display"]:""; |
|---|
| 13 | | $action = isset($_REQUEST["action"])?$_REQUEST["action"]:""; |
|---|
| 14 | | // Was an update to a user's voicemail account performed? ($update_flag is true in such a case) |
|---|
| 15 | | $update_flag = isset($_REQUEST["update_flag"])?$_REQUEST["update_flag"]:"false"; |
|---|
| 16 | | |
|---|
| 17 | | // Verify that voicemail module exists on the system. |
|---|
| 18 | | if (function_exists("voicemail_getVoicemail") && function_exists("voicemail_saveVoicemail") && function_exists("voicemail_mailbox_get") && function_exists("voicemail_mailbox_add") && function_exists("voicemail_mailbox_del")) { |
|---|
| 19 | | $vm_exists = TRUE; |
|---|
| | 2 | /* |
|---|
| | 3 | This program is free software; you can redistribute it and/or |
|---|
| | 4 | modify it under the terms of the GNU General Public License |
|---|
| | 5 | as published by the Free Software Foundation; either version 2 |
|---|
| | 6 | of the License, or (at your option) any later version. |
|---|
| | 7 | |
|---|
| | 8 | This program is distributed in the hope that it will be useful, |
|---|
| | 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| | 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| | 11 | GNU General Public License for more details. |
|---|
| | 12 | */ |
|---|
| | 13 | |
|---|
| | 14 | /* All extensions. */ |
|---|
| | 15 | $extens = core_users_list(); |
|---|
| | 16 | /* All voicemail.conf settings. */ |
|---|
| | 17 | $uservm = voicemail_getVoicemail(); |
|---|
| | 18 | /* VMAIL info - needed for rnav menu and other page content. */ |
|---|
| | 19 | $vmail_info["activated_info"] = array(); |
|---|
| | 20 | $vmail_info["bycontext"] = array(); |
|---|
| | 21 | $vmail_info["unactivated_info"] = array(); |
|---|
| | 22 | $vmail_info["disabled_list"] = array(); |
|---|
| | 23 | $vmail_info["contexts"] = array(); |
|---|
| | 24 | $vmail_info["contexts"] = array_keys($uservm); /* All voicemail contexts. */ |
|---|
| | 25 | |
|---|
| | 26 | $extdisplay = isset($_REQUEST["ext"])?$_REQUEST["ext"]:""; |
|---|
| | 27 | $type = (isset($_REQUEST["type"]) && $_REQUEST["type"] != "")?$_REQUEST["type"]:"setup"; |
|---|
| | 28 | $display = (isset($_REQUEST["display"]) && $_REQUEST["display"] != "")?$_REQUEST["display"]:"vmailadmin"; |
|---|
| | 29 | |
|---|
| | 30 | $rnav_list = ""; |
|---|
| | 31 | $rnav_enabled_index = array(); |
|---|
| | 32 | $rnav_entries = array(); |
|---|
| | 33 | |
|---|
| | 34 | /* Activated mailboxes are those which have a subdirectory on disk. */ |
|---|
| | 35 | global $amp_conf; |
|---|
| | 36 | $vmail_root = "/" . trim($amp_conf["ASTSPOOLDIR"] , "/") . "/voicemail"; |
|---|
| | 37 | |
|---|
| | 38 | if (isset($extens) && is_array($extens)) { |
|---|
| | 39 | $i = 0; |
|---|
| | 40 | foreach ($extens as $key => $exten) { |
|---|
| | 41 | $vmbox = null; |
|---|
| | 42 | /* Voicemail is enabled for this extension when it is associated with a voicemail context. */ |
|---|
| | 43 | foreach ($vmail_info["contexts"] as $vmcontext) { |
|---|
| | 44 | if (isset($uservm[$vmcontext][$exten[0]])) { |
|---|
| | 45 | $vmbox["context"] = $vmcontext; |
|---|
| | 46 | break; |
|---|
| | 47 | } |
|---|
| | 48 | } |
|---|
| | 49 | |
|---|
| | 50 | /* FOR RNAV MENU */ |
|---|
| | 51 | $name = $exten[1]; |
|---|
| | 52 | $unactivated_style = ""; |
|---|
| | 53 | $unactivated_txt = ""; |
|---|
| | 54 | $disabled_style = ""; |
|---|
| | 55 | $disabled_txt = ""; |
|---|
| | 56 | $c = ""; |
|---|
| | 57 | $c = isset($vmbox["context"])?$vmbox["context"]:""; |
|---|
| | 58 | if ($vmbox !== null) { |
|---|
| | 59 | $vmail_info["bycontext"][$vmbox["context"]][] = $exten[0]; |
|---|
| | 60 | $vmbox["path"] = $vmail_root . "/" . $vmbox["context"] . "/" . $exten[0]; |
|---|
| | 61 | $rnav_enabled_index[$vmbox["context"]][] = $i; |
|---|
| | 62 | if (is_dir($vmbox["path"])) { |
|---|
| | 63 | $vmail_info["activated_info"][$exten[0]] = $vmbox["context"]; |
|---|
| | 64 | } else { |
|---|
| | 65 | $vmail_info["unactivated_info"][$exten[0]] = $vmbox["context"]; |
|---|
| | 66 | $unactivated_style = " style='background: #abc9ff;'"; |
|---|
| | 67 | $unactivated_txt = " [unactivated]"; |
|---|
| | 68 | } |
|---|
| | 69 | $link = "config.php?type=" . $type . "&display=" . $display . "&ext=" . $exten[0] . "&action=bsettings#" . $exten[0]; |
|---|
| | 70 | } else { |
|---|
| | 71 | /* Voicemail is disabled for this extension. */ |
|---|
| | 72 | $vmail_info["disabled_list"][] = $exten[0]; |
|---|
| | 73 | $disabled_txt = "disabled"; |
|---|
| | 74 | $disabled_style = " style='background: #ffffcc; text-decoration: line-through;'"; |
|---|
| | 75 | /* Distinguish between "extensions" and "deviceanduser" modes. */ |
|---|
| | 76 | if (isset($amp_conf["AMPEXTENSIONS"]) && ($amp_conf["AMPEXTENSIONS"] == "extensions")) { |
|---|
| | 77 | $link = "config.php?type=setup&display=extensions&extdisplay=" . $exten[0] . "#" . $exten[0]; |
|---|
| | 78 | } else { |
|---|
| | 79 | $link = "config.php?type=setup&display=users&extdisplay=" . $exten[0] . "#" . $exten[0]; |
|---|
| | 80 | } |
|---|
| | 81 | } |
|---|
| | 82 | $rnav_entries[$i] = "\t<li id='vmailadmin_list_" . $exten[0] . "'${disabled_style}${unactivated_style}><a" . ($extdisplay==$exten[0] ? ' class="current"':'') . "${disabled_style}${unactivated_style} href=\"$link\" onHover='menuUpdatePos();'>{$name} <" . $exten[0] . "> (${c}${disabled_txt})${unactivated_txt}</a></li>\n"; |
|---|
| | 83 | $i++; |
|---|
| | 84 | } |
|---|
| | 85 | } |
|---|
| | 86 | |
|---|
| | 87 | /* End VMAIL info processing. */ |
|---|
| | 88 | |
|---|
| | 89 | /* Settings options */ |
|---|
| | 90 | $dlen = 800; /* default max length on text entry */ |
|---|
| | 91 | $gen_settings = array( "adsifdn" => array("ver" => 1.2, "len" => 4, "type" => "char"), |
|---|
| | 92 | "adsisec" => array("ver" => 1.2, "len" => 4, "type" => "char"), |
|---|
| | 93 | "adsiver" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 94 | "attach" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 95 | "authpassword" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 96 | "authuser" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 97 | "backupdeleted" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 98 | "callback" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 99 | "charset" => array("ver" => 1.2, "len" => 32, "type" => "char"), |
|---|
| | 100 | "cidinternalcontexts" => array("ver" => 1.2, "len" => 640, "type" => "char"), |
|---|
| | 101 | "dialout" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 102 | "emailbody" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 103 | "emaildateformat" => array("ver" => 1.2, "len" => 32, "type" => "char"), |
|---|
| | 104 | "emailsubject" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 105 | "envelope" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 106 | "exitcontext" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 107 | "expungeonhangup" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 108 | "externnotify" => array("ver" => 1.2, "len" => 160, "type" => "char"), |
|---|
| | 109 | "externpass" => array("ver" => 1.2, "len" => 128, "type" => "char"), |
|---|
| | 110 | "externpassnotify" => array("ver" => 1.6, "len" => 128, "type" => "char"), |
|---|
| | 111 | "forcegreetings" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 112 | "forcename" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 113 | "format" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 114 | "fromstring" => array("ver" => 1.2, "len" => 100, "type" => "char"), |
|---|
| | 115 | "greetingsfolder" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 116 | "imapclosetimeout" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 117 | "imapflags" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 118 | "imapfolder" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 119 | "imapgreetings" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 120 | "imapopentimeout" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 121 | "imapparentfolder" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 122 | "imapport" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 123 | "imapreadtimeout" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 124 | "imapserver" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 125 | "imapwritetimeout" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 126 | "listen-control-forward-key" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 127 | "listen-control-pause-key" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 128 | "listen-control-restart-key" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 129 | "listen-control-reverse-key" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 130 | "listen-control-stop-key" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 131 | "mailcmd" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 132 | "maxgreet" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 133 | "maxlogins" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 134 | "maxmessage" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 135 | "maxmsg" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 136 | "maxsecs" => array("ver" => 1.6, "len" => $dlen, "type" => "num"), |
|---|
| | 137 | "maxsilence" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 138 | "minsecs" => array("ver" => 1.6, "len" => $dlen, "type" => "num"), |
|---|
| | 139 | "moveheard" => array("ver" => 1.6, "len" => 0, "type" => "flag"), |
|---|
| | 140 | "nextaftercmd" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 141 | "obdcstorage" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 142 | "odbctable" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 143 | "operator" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 144 | "pagerbody" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 145 | "pagerfromstring" => array("ver" => 1.2, "len" => 100, "type" => "char"), |
|---|
| | 146 | "pagersubject" => array("ver" => 1.2, "len" => $dlen, "type" => "char"), |
|---|
| | 147 | "pbxskip" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 148 | "pollfreq" => array("ver" => 1.6, "len" => $dlen, "type" => "num"), |
|---|
| | 149 | "pollmailboxes" => array("ver" => 1.6, "len" => 0, "type" => "flag"), |
|---|
| | 150 | "review" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 151 | "saycid" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 152 | "sayduration" => array("ver" => 1.2, "len" => $dlen, "type" => "flag"), |
|---|
| | 153 | "saydurationm" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 154 | "searchcontexts" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 155 | "sendvoicemail" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 156 | "serveremail" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 157 | "silencethreshold" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 158 | "skipms" => array("ver" => 1.2, "len" => $dlen, "type" => "num"), |
|---|
| | 159 | "smdienable" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 160 | "smdiport" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 161 | "tempgreetwarn" => array("ver" => 1.4, "len" => $dlen, "type" => "flag"), |
|---|
| | 162 | "usedirectory" => array("ver" => 1.4, "len" => 0, "type" => "flag"), |
|---|
| | 163 | "userscontext" => array("ver" => 1.4, "len" => $dlen, "type" => "char"), |
|---|
| | 164 | "vm-mismatch" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 165 | "vm-newpassword" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 166 | "vm-passchanged" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 167 | "vm-password" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 168 | "vm-reenterpassword" => array("ver" => 1.6, "len" => $dlen, "type" => "char"), |
|---|
| | 169 | "volgain" => array("ver" => 1.4, "len" => $dlen, "type" => "num") ); |
|---|
| | 170 | |
|---|
| | 171 | $acct_settings = array( "attach" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 172 | "attachfmt" => array("ver" => 1.4, "len" => 20, "type" => "char"), |
|---|
| | 173 | "backupdeleted" => array("ver" => 1.6, "len" => 0, "type" => "num"), |
|---|
| | 174 | "callback" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 175 | "callmenum" => array("ver" => 1.2, "len" => 0, "type" => "num"), |
|---|
| | 176 | "delete" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 177 | "dialout" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 178 | "email" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 179 | "envelope" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 180 | "exitcontext" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 181 | "forcegreetings" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 182 | "forcename" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 183 | "hidefromdir" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 184 | "imappassword" => array("ver" => 1.4, "len" => 80, "type" => "char"), |
|---|
| | 185 | "imapuser" => array("ver" => 1.4, "len" => 80, "type" => "char"), |
|---|
| | 186 | "language" => array("ver" => 1.4, "len" => 20, "type" => "char"), |
|---|
| | 187 | "maxmessage" => array("ver" => 1.2, "len" => 0, "type" => "num"), |
|---|
| | 188 | "maxmsg" => array("ver" => 1.2, "len" => 0, "type" => "num"), |
|---|
| | 189 | "maxsecs" => array("ver" => 1.6, "len" => 0, "type" => "num"), |
|---|
| | 190 | "moveheard" => array("ver" => 1.6, "len" => 0, "type" => "flag"), |
|---|
| | 191 | "name" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 192 | "operator" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 193 | "pager" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 194 | "pwd" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 195 | "review" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 196 | "saycid" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 197 | "sayduration" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 198 | "saydurationm" => array("ver" => 1.2, "len" => 0, "type" => "num"), |
|---|
| | 199 | "sendvoicemail" => array("ver" => 1.2, "len" => 0, "type" => "flag"), |
|---|
| | 200 | "serveremail" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 201 | "tempgreetwarn" => array("ver" => 1.4, "len" => 0, "type" => "flag"), |
|---|
| | 202 | "tz" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 203 | "vmcontext" => array("ver" => 1.2, "len" => 80, "type" => "char"), |
|---|
| | 204 | "volgain" => array("ver" => 1.4, "len" => 0, "type" => "num") ); |
|---|
| | 205 | |
|---|
| | 206 | $tooltips = array("tz" => array("name" => _("Timezone definition name"), |
|---|
| | 207 | "def" => _("Time announcement for message playback"), |
|---|
| | 208 | "del" => _("Remove the timezone definition")), |
|---|
| | 209 | "general" => array("adsifdn" => _("The ADSI feature descriptor number to download to"), |
|---|
| | 210 | "adsisec" => _("The ADSI security lock code"), |
|---|
| | 211 | "adsiver" => _("The ADSI voicemail application version number."), |
|---|
| | 212 | "attach" => _("Option to attach voicemails to email."), |
|---|
| | 213 | "authpassword" => _("IMAP server master password."), |
|---|
| | 214 | "authuser" => _("IMAP server master username."), |
|---|
| | 215 | "backupdeleted" => _("No. of deleted messages saved per mailbox (can be a number or yes/no, yes meaning MAXMSG, no meaning 0)."), |
|---|
| | 216 | "callback" => _("Context to call back from; if not listed, calling the sender back will not be permitted."), |
|---|
| | 217 | "charset" => _("The character set for voicemail messages"), |
|---|
| | 218 | "cidinternalcontexts" => _("Comma separated list of internal contexts to use caller ID."), |
|---|
| | 219 | "dialout" => _("Context to dial out from [option 4 from the advanced menu] if not listed, dialing out will not be permitted."), |
|---|
| | 220 | "emailbody" => _("Email body."), |
|---|
| | 221 | "emaildateformat" => _("Load date format config for voicemail mail."), |
|---|
| | 222 | "emailsubject" => _("Email subject"), |
|---|
| | 223 | "maxsilence" => _("How many seconds of silence before we end the recording"), |
|---|
| | 224 | "envelope" => _("Turn on/off envelope playback before message playback. [ON by default] This does NOT affect option 3,3 from the advanced options menu."), |
|---|
| | 225 | "exitcontext" => _("Context to check for handling * or 0 calls to operator. \"Operator Context\""), |
|---|
| | 226 | "expungeonhangup" => _("Expunge on exit."), |
|---|
| | 227 | "externnotify" => _("External voicemail notify application."), |
|---|
| | 228 | "externpass" => _("External password changing command (overrides externpassnotify)."), |
|---|
| | 229 | "externpassnotify" => _("Command specified runs after a user changes his password."), |
|---|
| | 230 | "forcegreetings" => _("Force new user to record greetings (the same as forcename, except for recording greetings). The default is \"no\"."), |
|---|
| | 231 | "forcename" => _("Force a new user to record their name. A new user is determined by the password being the same as the mailbox number. The default is \"no\"."), |
|---|
| | 232 | "format" => _("Formats for writing Voicemail. Note that when using IMAP storage for voicemail, only the first format specified will be used."), |
|---|
| | 233 | "fromstring" => _("From: string for email"), |
|---|
| | 234 | "imapclosetimeout" => _("For IMAP storage"), |
|---|
| | 235 | "imapflags" => _("IMAP server flags."), |
|---|
| | 236 | "imapfolder" => _("IMAP voicemail folder."), |
|---|
| | 237 | "imapgreetings" => _("If using IMAP storage, specify whether voicemail greetings should be stored via IMAP. If no, then greetings are stored as if IMAP storage were not enabled"), |
|---|
| | 238 | "greetingsfolder" => _("(yes/no) If imapgreetings=yes, then specify which folder to store your greetings in. If you do not specify a folder, then INBOX will be used."), |
|---|
| | 239 | "imapopentimeout" => _("For IMAP storage - TCP open timeout in seconds"), |
|---|
| | 240 | "imapparentfolder" => _("Set the parent folder (default is to have no parent folder set)."), |
|---|
| | 241 | "imapport" => _("IMAP server port."), |
|---|
| | 242 | "imapreadtimeout" => _("For IMAP storage - TCP read timeout in seconds"), |
|---|
| | 243 | "imapserver" => _("IMAP server address."), |
|---|
| | 244 | "imapwritetimeout" => _("For IMAP storage - TCP write timeout in seconds"), |
|---|
| | 245 | "listen-control-forward-key" => _("Customize the key that fast-forwards message playback"), |
|---|
| | 246 | "listen-control-pause-key" => _("Customize the key that pauses/unpauses message playback"), |
|---|
| | 247 | "listen-control-restart-key" => _("Customize the key that restarts message playback"), |
|---|
| | 248 | "listen-control-reverse-key" => _("Customize the key that rewinds message playback"), |
|---|
| | 249 | "listen-control-stop-key" => _("Customize the key that stops message playback"), |
|---|
| | 250 | "mailcmd" => _("Mail command."), |
|---|
| | 251 | "maxgreet" => _("Max message greeting length."), |
|---|
| | 252 | "maxlogins" => _("Max failed login attempts."), |
|---|
| | 253 | "maxmessage" => _("Max message time length."), |
|---|
| | 254 | "maxsecs" => _("Max message time length."), |
|---|
| | 255 | "maxmsg" => _("Maximum number of messages per folder. If not specified, a default value (100) is used. Maximum value for this option is 9999."), |
|---|
| | 256 | "minsecs" => _("Min message time length - maxsilence should be less than minsecs or you may get empty messages."), |
|---|
| | 257 | "moveheard" => _("Move heard messages to the 'Old' folder automagically. Defaults to on."), |
|---|
| | 258 | "nextaftercmd" => _("Skip to the next message after save/delete."), |
|---|
| | 259 | "obdcstorage" => _("The value of odbcstorage is the database connection configured in res_odbc.conf."), |
|---|
| | 260 | "odbctable" => _("The default table for ODBC voicemail storage is voicemessages."), |
|---|
| | 261 | "operator" => _("Operator break. Allow sender to hit 0 before/after/during leaving a voicemail to reach an operator [OFF by default]"), |
|---|
| | 262 | "pagerbody" => _("Body of message sent to pager."), |
|---|
| | 263 | "pagerfromstring" => _("From: string sent to pager."), |
|---|
| | 264 | "pagersubject" => _("Subject sent to pager."), |
|---|
| | 265 | "pbxskip" => _("Skip the \"[PBX]:\" string from the message title"), |
|---|
| | 266 | "pollfreq" => _("If the \"pollmailboxes\" option is enabled, this option sets the polling frequency. The default is once every 30 seconds."), |
|---|
| | 267 | "pollmailboxes" => _("If mailboxes are changed anywhere outside of app_voicemail, then this option must be enabled for MWI to work. This enables polling mailboxes for changes. Normally, it will expect that changes are only made when someone called in to one of the voicemail applications. Examples of situations that would require this option are web interfaces to voicemail or an email client in the case of using IMAP storage."), |
|---|
| | 268 | "review" => _("Allow sender to review/rerecord their message before saving it [OFF by default]"), |
|---|
| | 269 | "saycid" => _("Read back caller's telephone number prior to playing the incoming message, and just after announcing the date and time the message was left. If not described, or set to no, it will be in the envelope."), |
|---|
| | 270 | "sayduration" => _("Turn on/off saying duration information before the message playback. [ON by default]"), |
|---|
| | 271 | "saydurationm" => _("Specify in minutes the minimum duration to say. Default is 2 minutes."), |
|---|
| | 272 | "searchcontexts" => _("Yes to search all contexts, no to search current context (if one is not specified)."), |
|---|
| | 273 | "sendvoicemail" => _("Send voicemail message. If not listed, sending messages from inside voicemail will not be permitted."), |
|---|
| | 274 | "serveremail" => _("Who the e-mail notification should appear to come from"), |
|---|
| | 275 | "silencethreshold" => _("Silence threshold (what we consider silence: the lower, the more sensitive)"), |
|---|
| | 276 | "skipms" => _("How many milliseconds to skip forward/back when rew/ff in message playback"), |
|---|
| | 277 | "smdienable" => _("Enable Simple Message Desk Interface (SMDI) integration"), |
|---|
| | 278 | "smdiport" => _("Valid port as specified in smdi.conf for using smdi for external notification."), |
|---|
| | 279 | "tempgreetwarn" => _("Temporary greeting reminder."), |
|---|
| | 280 | "usedirectory" => _("Permit finding entries for forward/compose from the directory"), |
|---|
| | 281 | "userscontext" => _("User context is where entries from users.conf are registered. The default value is 'default'"), |
|---|
| | 282 | "vm-mismatch" => _("Customize which sound file is used instead of the default prompt that says: \"The passwords you entered and re-entered did not match. Please try again.\""), |
|---|
| | 283 | "vm-newpassword" => _("Customize which sound file is used instead of the default prompt that says: \"Please enter your new password followed by the pound key.\""), |
|---|
| | 284 | "vm-passchanged" => _("Customize which sound file is used instead of the default prompt that says: \"Your password has been changed.\""), |
|---|
| | 285 | "vm-password" => _("Customize which sound file is used instead of the default prompt that says: \"password\""), |
|---|
| | 286 | "vm-reenterpassword" => _("Customize which sound file is used instead of the default prompt that says: \"Please re-enter your password followed by the pound key\""), |
|---|
| | 287 | "volgain" => _("Emails bearing the voicemail may arrive in a volume too quiet to be heard. This parameter allows you to specify how much gain to add to the message when sending a voicemail. NOTE: sox must be installed for this option to work.") |
|---|
| | 288 | ), |
|---|
| | 289 | "account" => array("pwd" => _("This is the password used to access the voicemail system.<br /><br />This password can only contain numbers.<br /><br />A user can change the password you enter here after logging into the voicemail system (*98) with a phone."), |
|---|
| | 290 | "attach" => _("Option to attach voicemails to email."), |
|---|
| | 291 | "attachfmt" => _("Which format of audio file to attach to the email."), |
|---|
| | 292 | "backupdeleted" => _("No. of deleted messages saved per mailbox (can be a number or yes/no, yes meaning MAXMSG, no meaning 0)."), |
|---|
| | 293 | "callback" => _("Context to call back from; if not listed, calling the sender back will not be permitted."), |
|---|
| | 294 | "delete" => _("After notification, the voicemail is deleted from the server. [per-mailbox only] This is intended for use with users who wish to receive their voicemail ONLY by email. Note: deletevoicemail is provided as an equivalent option for Realtime configuration."), |
|---|
| | 295 | "dialout" => _("Context to dial out from [option 4 from the advanced menu] if not listed, dialing out will not be permitted."), |
|---|
| | 296 | "email" => _("The email address that voicemails are sent to."), |
|---|
| | 297 | "envelope" => _("Turn on/off envelope playback before message playback. [ON by default] This does NOT affect option 3,3 from the advanced options menu."), |
|---|
| | 298 | "exitcontext" => _("Context to check for handling * or 0 calls to operator. \"Operator Context\""), |
|---|
| | 299 | "forcegreetings" => _("Force new user to record greetings (the same as forcename, except for recording greetings). The default is \"no\"."), |
|---|
| | 300 | "forcename" => _("Force a new user to record their name. A new user is determined by the password being the same as the mailbox number. The default is \"no\"."), |
|---|
| | 301 | "fullname" => _("Name of voicemail account"), |
|---|
| | 302 | "hidefromdir" => _("Hide this mailbox from the directory produced by app_directory. The default is \"no\"."), |
|---|
| | 303 | "imappassword" => _("IMAP password."), |
|---|
| | 304 | "imapuser" => _("IMAP user."), |
|---|
| | 305 | "language" => _("Asterisk language code"), |
|---|
| | 306 | "maxmsg" => _("Maximum number of messages per folder. If not specified, a default value (100) is used. Maximum value for this option is 9999."), |
|---|
| | 307 | "maxmessage" => _("Max message time length."), |
|---|
| | 308 | "maxsecs" => _("Max message time length."), |
|---|
| | 309 | "moveheard" => _("Move heard messages to the 'Old' folder automagically. Defaults to on."), |
|---|
| | 310 | "name" => _("Name of account/user"), |
|---|
| | 311 | "operator" => _("Operator break. Allow sender to hit 0 before/after/during leaving a voicemail to reach an operator [OFF by default]"), |
|---|
| | 312 | "pager" => _("Pager/mobile email address that short voicemail notifications are sent to."), |
|---|
| | 313 | "review" => _("Allow sender to review/rerecord their message before saving it [OFF by default]"), |
|---|
| | 314 | "saycid" => _("Read back caller's telephone number prior to playing the incoming message, and just after announcing the date and time the message was left. If not described, or set to no, it will be in the envelope."), |
|---|
| | 315 | "sayduration" => _("Turn on/off saying duration information before the message playback. [ON by default]"), |
|---|
| | 316 | "saydurationm" => _("Specify in minutes the minimum duration to say. Default is 2 minutes."), |
|---|
| | 317 | "sendvoicemail" => _("Send voicemail message. If not listed, sending messages from inside voicemail will not be permitted."), |
|---|
| | 318 | "serveremail" => _("Who the e-mail notification should appear to come from"), |
|---|
| | 319 | "tempgreetwarn" => _("Remind the user that their temporary greeting is set"), |
|---|
| | 320 | "tz" => _("Timezone from zonemessages context. Irrelevant if envelope=no."), |
|---|
| | 321 | "vmcontext" => _("This is the Voicemail Context which is normally set to default. Do not change unless you understand the implications."), |
|---|
| | 322 | "volgain" => _("Emails bearing the voicemail may arrive in a volume too quiet to be heard. This parameter allows you to specify how much gain to add to the message when sending a voicemail. NOTE: sox must be installed for this option to work."), |
|---|
| | 323 | "callmenum" => _("Call me number. Can be used from within ARI.") |
|---|
| | 324 | ) |
|---|
| | 325 | ); |
|---|
| | 326 | |
|---|
| | 327 | /* End settings options */ |
|---|
| | 328 | |
|---|
| | 329 | /* Data needed to display correct page. */ |
|---|
| | 330 | $type = (isset($_REQUEST["type"]) && $_REQUEST["type"] != "")?$_REQUEST["type"]:"setup"; |
|---|
| | 331 | $display = (isset($_REQUEST["display"]) && $_REQUEST["display"] != "")?$_REQUEST["display"]:"vmailadmin"; |
|---|
| | 332 | if (isset($_REQUEST["updated"])) { |
|---|
| | 333 | if ($_REQUEST["updated"] == "true") { |
|---|
| | 334 | $update_flag = true; |
|---|
| | 335 | } else { |
|---|
| | 336 | $update_flag = false; |
|---|
| | 337 | } |
|---|
| 25 | | case "changevmailsettings": |
|---|
| 26 | | // The voicemail functions have their own internal |
|---|
| 27 | | // checking. |
|---|
| 28 | | // If the voicemail box in question does not exist, |
|---|
| 29 | | // the functions simply return. No harm done. |
|---|
| 30 | | // |
|---|
| 31 | | // We do NOT call voicemail_mailbox_remove - we do NOT want to delete |
|---|
| 32 | | // anything from the user's mailbox. |
|---|
| 33 | | if ($vm_exists) { |
|---|
| 34 | | $mbox = isset($_REQUEST["extension"])?$_REQUEST["extension"]:NULL; |
|---|
| 35 | | $vm = isset($_REQUEST["vm"])?$_REQUEST["vm"]:"disabled"; |
|---|
| 36 | | // Delete the user's current voicemail settings. |
|---|
| 37 | | voicemail_mailbox_del($_REQUEST["extension"]); |
|---|
| 38 | | if ($vm != "disabled") { |
|---|
| 39 | | // Prepare all data for being saved into the voicemail configuration. |
|---|
| 40 | | // We do not use voicemail_mailbox_add, since that function also |
|---|
| 41 | | // tweaks the vmx settings. This module only accesses the voicemail |
|---|
| 42 | | // configuration stored in voicemail.conf. |
|---|
| 43 | | if ($mbox !== NULL) { |
|---|
| 44 | | $uservm = voicemail_getVoicemail(); |
|---|
| 45 | | $vmpwd = isset($_REQUEST["vmpwd"])?$_REQUEST["vmpwd"]:""; |
|---|
| 46 | | //$name = (isset($_REQUEST["name"]) && $_REQUEST["name"] != "")?$_REQUEST["name"]:$this_exten[1]; |
|---|
| 47 | | if (isset($_REQUEST["name"]) && $_REQUEST["name"] != "") { |
|---|
| 48 | | $name = $_REQUEST["name"]; |
|---|
| 49 | | } else { |
|---|
| 50 | | $this_exten = core_users_get($extension); |
|---|
| 51 | | $name = $this_exten["name"]; |
|---|
| | 429 | case "tz": |
|---|
| | 430 | /* get tz settings */ |
|---|
| | 431 | $settings = vmailadmin_get_settings($uservm, $action, $extension); |
|---|
| | 432 | $output .= "<tr><td colspan='2'><hr /></td><td></td></tr>"; |
|---|
| | 433 | $output .= "<tr><td style='max-width: 60px' colspan='2'>" . _("A timezone definition specifies how the voicemail system announces the time.") . "</td><td></td></tr>"; |
|---|
| | 434 | $output .= "<tr><td style='max-width: 60px' colspan='2'>" . _("For example, the time a message was left will be announced according to the user's timezone on message playback.") . "</td><td></td></tr>"; |
|---|
| | 435 | $output .= "<tr><td></td><td></td></tr>"; |
|---|
| | 436 | $output .= "<tr><td style='max-width: 60px' colspan='2'><b>" . _("Entries below will be written to voicemail configuration as-is.") . "</b></td><td></td></tr>"; |
|---|
| | 437 | $output .= "<tr><td style='max-width: 60px' colspan='2'><b>" . _("Please be sure to follow the format for timezone definitions described below.") . "</b></td></tr>"; |
|---|
| | 438 | $output .= "<tr><td colspan='2'><hr /></td><td></td></tr>"; |
|---|
| | 439 | $output .= "<tr><td><a href='#' class='info'><h4>" . _("Name") . "</h4><span>" . $tooltips["tz"]["name"] . "</span></a></td><td><a href='#' class='info'><h4>" . _("Timezone Definition") . "</h4><span>" . $tooltips["tz"]["def"] . "</span></a>"; |
|---|
| | 440 | $output .= "</td></tr>"; |
|---|
| | 441 | if (is_array($settings) && !empty($settings)) { |
|---|
| | 442 | foreach ($settings as $key => $val) { |
|---|
| | 443 | $output .= "<tr>"; |
|---|
| | 444 | $output .= "<td>$key</td>"; |
|---|
| | 445 | $output .= "<td><input size='50' type='text' name='tz__$key' id='tz__$key' tabindex='1' value=\"$val\" />"; |
|---|
| | 446 | $output .= " <input type='checkbox' name='tzdel__$key' id='tzdel__$key' value='true' /> <a href='#' class='info'>" . _("Delete") . "<span>" . $tooltips["tz"]["del"] . "</span></a></td></tr>"; |
|---|
| | 447 | } |
|---|
| | 448 | } |
|---|
| | 449 | $output .= "<tr><td coslpan='2'></td></tr>"; |
|---|
| | 450 | $output .= "<tr><td><a href='#' class='info'><h4>" . _("New Name") . "</h4><span>" . $tooltips["tz"]["name"] . "</span></a></td><td><a href='#' class='info'><h4>" . _("New Timezone Definition") . "</h4><span>" . $tooltips["tz"]["def"] . "</span></a></td>"; |
|---|
| | 451 | $output .= "<tr><td><input size='10' type='text' name='tznew_name' id='tznew_name' tabindex='1' value='' /></td>"; |
|---|
| | 452 | $output .= "<td><input size='50' type='text' name='tznew_def' id='tznew_def' tabindex='1' value='' /></td></tr>"; |
|---|
| | 453 | |
|---|
| | 454 | $update_notice = ($update_flag == false)?" <b><u>UPDATE FAILED</u></b>":""; |
|---|
| | 455 | $update_notice = ($update_flag == true)?" <b><u>UPDATE COMPLETED</u></b>":""; |
|---|
| | 456 | $output .= "<tr><td></td><td colspan='2'><input type='submit' name='action' id='action' value='Submit' />" . $update_notice . "</td></tr>"; |
|---|
| | 457 | |
|---|
| | 458 | $output .= "<tr><td colspan='2'><hr /></td></tr>"; |
|---|
| | 459 | $output .= "<tr><td style='max-width: 60px' colspan='2'>" . _("Timezone definition format is: ") . " <b style='font-family:courier;'>" . _("timezone|values") . "</b></td><td></td></tr>"; |
|---|
| | 460 | $output .= "<tr><td style='max-width: 60px' colspan='2'><br /><b>" . _("<i>Timezones</i> are listed in /usr/share/zoneinfo") . "</td></tr>"; |
|---|
| | 461 | $output .= "<tr><td style='max-width: 60px' colspan='2'><b>" . _("The <i>values</i> supported in the timezone definition string include:") . "</b></td></tr>" . |
|---|
| | 462 | "<tr><td>" . _("'filename'") . "</td><td style='max-width: 60px' colspan='2'>" . _("The name of a sound file (the file name must be single-quoted)") . "</td></tr>" . |
|---|
| | 463 | "<tr><td>" . _("variable") . "</td><td style='max-width: 60px' colspan='2'>" . _("A variable to be substituted (see below for supported variable values)") . "</td></tr>"; |
|---|
| | 464 | $output .= "<tr><td style='max-width: 60px' colspan='2'><b>" . _("Supported <i>variables</i>:") . "</b></td></tr>" . |
|---|
| | 465 | "<tr><td style='max-width: 60px'>" . _("A or a") . "</td><td style='max-width: 60px' colspan='2'>" . _("Day of week (Saturday, Sunday, ...)") . "</td></tr>" . |
|---|
| | 466 | "<tr><td style='max-width: 60px'>" . _("B or b or h") . "</td><td style='max-width: 60px' colspan='2'>" . _("Month name (January, February, ...)") . "</td></tr>" . |
|---|
| | 467 | "<tr><td style='max-width: 60px'>" . _("d or e") . "</td><td style='max-width: 60px' colspan='2'>" . _("numeric day of month (first, second, ..., thirty-first)") . "</td></tr>" . |
|---|
| | 468 | "<tr><td style='max-width: 60px'>" . _("Y") . "</td><td style='max-width: 60px' colspan='2'>" . _("Year") . "</td></tr>" . |
|---|
| | 469 | "<tr><td style='max-width: 60px'>" . _("I or l") . "</td><td style='max-width: 60px' colspan='2'>" . _("Hour, 12 hour clock") . "</td></tr>" . |
|---|
| | 470 | "<tr><td style='max-width: 60px'>" . _("H") . "</td><td style='max-width: 60px' colspan='2'>" . _("Hour, 24 hour clock (single digit hours preceded by \"oh\")") . "</td></tr>" . |
|---|
| | 471 | "<tr><td style='max-width: 60px'>" . _("k") . "</td><td style='max-width: 60px' colspan='2'>" . _("Hour, 24 hour clock (single digit hours NOT preceded by \"oh\")") . "</td></tr>" . |
|---|
| | 472 | "<tr><td style='max-width: 60px'>" . _("M") . "</td><td style='max-width: 60px' colspan='2'>" . _("Minute, with 00 pronounced as \"o'clock\"") . "</td></tr>" . |
|---|
| | 473 | "<tr><td style='max-width: 60px'>" . _("N") . "</td><td style='max-width: 60px' colspan='2'>" . _("Minute, with 00 pronounced as \"hundred\" (US military time)") . "</td></tr>" . |
|---|
| | 474 | "<tr><td style='max-width: 60px'>" . _("P or p") . "</td><td style='max-width: 60px' colspan='2'>" . _("AM or PM") . "</td></tr>" . |
|---|
| | 475 | "<tr><td style='max-width: 60px'>" . _("Q") . "</td><td style='max-width: 60px' colspan='2'>" . _("\"today\", \"yesterday\" or ABdY") . "</td></tr>" . |
|---|
| | 476 | "<tr><td style='max-width: 60px'>" . _("q") . "</td><td style='max-width: 60px' colspan='2'>" . _("\"\" (for today), \"yesterday\", weekday, or ABdY") . "</td></tr>" . |
|---|
| | 477 | "<tr><td style='max-width: 60px'>" . _("R") . "</td><td style='max-width: 60px' colspan='2'>" . _("24 hour time, including minute") . "</td></tr>"; |
|---|
| | 478 | break; |
|---|
| | 479 | case "bsettings": |
|---|
| | 480 | case "settings": |
|---|
| | 481 | /* get settings */ |
|---|
| | 482 | $settings = vmailadmin_get_settings($uservm, $action, $extension); |
|---|
| | 483 | /* Get Asterisk version. */ |
|---|
| | 484 | $ast_info = engine_getinfo(); |
|---|
| | 485 | $version = $ast_info["version"]; |
|---|
| | 486 | $text_size = 40; |
|---|
| | 487 | |
|---|
| | 488 | if (!empty($extension)) { |
|---|
| | 489 | $acct_title_links = "<tr><td><h5>" . _("Account View Links:") . " </h5></td><td colspan='2'><h5><a href='config.php?type=$type&display=$display&action=bsettings&ext=$extension'>" . _("Settings") . "</a> | "; |
|---|
| | 490 | $acct_title_links .= "<a href='config.php?type=$type&display=$display&action=usage&ext=$extension'>" . _("Usage") . "</a> | <a style='color:#ff9933;' href='config.php?type=$type&display=$display&action=settings&ext=$extension'>" . _("Advanced Settings") . "</a></h5></td></tr><tr><td colspan='2'><hr /></td></tr>"; |
|---|
| | 491 | $display_settings = $acct_settings; |
|---|
| | 492 | $display_tips = $tooltips["account"]; |
|---|
| | 493 | $id_prefix = "acct"; |
|---|
| | 494 | } else { |
|---|
| | 495 | $acct_title_links = ""; |
|---|
| | 496 | $output .= "<tr><td colspan='2'><hr /></td></tr>"; |
|---|
| | 497 | $display_settings = $gen_settings; |
|---|
| | 498 | $display_tips = $tooltips["general"]; |
|---|
| | 499 | $id_prefix = "gen"; |
|---|
| | 500 | } |
|---|
| | 501 | $display_name_row = ""; |
|---|
| | 502 | if ($action == "bsettings") { |
|---|
| | 503 | # Overwrite account title links |
|---|
| | 504 | $acct_title_links = "<tr><td><h5>" . _("Account View Links:") . " </h5></td><td colspan='2'><h5><a style='color:#ff9933;' href='config.php?type=$type&display=$display&action=bsettings&ext=$extension'>" . _("Settings") . "</a> | "; |
|---|
| | 505 | $acct_title_links .= "<a href='config.php?type=$type&display=$display&action=usage&ext=$extension'>" . _("Usage") . "</a> | <a href='config.php?type=$type&display=$display&action=settings&ext=$extension'>" . _("Advanced Settings") . "</a></h5></td></tr><tr><td colspan='2'><hr /></td></tr>"; |
|---|
| | 506 | /* Display account name */ |
|---|
| | 507 | $display_name = isset($settings["name"])?$settings["name"]:_("No name defined; this is configured from the Extensions or Users page."); |
|---|
| | 508 | $display_name_row = "<tr><td><a href='#' class='info'>" . _("Name") . "<span>" . $tooltips["account"]["name"] . "</span></a></td><td> " . $display_name . "</td></tr>"; |
|---|
| | 509 | # Override display settings, so only the basic account settings appear. |
|---|
| | 510 | unset($display_settings); |
|---|
| | 511 | $basic_settings["pwd"] = isset($settings["pwd"])?$settings["pwd"]:""; |
|---|
| | 512 | $basic_settings["email"] = isset($settings["email"])?$settings["email"]:""; |
|---|
| | 513 | $basic_settings["pager"] = isset($settings["pager"])?$settings["pager"]:""; |
|---|
| | 514 | $basic_settings["attach"] = isset($settings["attach"])?$settings["attach"]:""; |
|---|
| | 515 | $basic_settings["saycid"] = isset($settings["saycid"])?$settings["saycid"]:""; |
|---|
| | 516 | $basic_settings["envelope"] = isset($settings["envelope"])?$settings["envelope"]:""; |
|---|
| | 517 | $basic_settings["delete"] = isset($settings["delete"])?$settings["delete"]:""; |
|---|
| | 518 | $basic_settings["callmenum"] = isset($settings["callmenum"])?$settings["callmenum"]:""; |
|---|
| | 519 | unset($settings); |
|---|
| | 520 | $settings = $basic_settings; |
|---|
| | 521 | $display_settings["pwd"] = $acct_settings["pwd"]; |
|---|
| | 522 | $display_settings["email"] = $acct_settings["email"]; |
|---|
| | 523 | $display_settings["pager"] = $acct_settings["pager"]; |
|---|
| | 524 | $display_settings["attach"] = $acct_settings["attach"]; |
|---|
| | 525 | $display_settings["saycid"] = $acct_settings["saycid"]; |
|---|
| | 526 | $display_settings["envelope"] = $acct_settings["envelope"]; |
|---|
| | 527 | $display_settings["delete"] = $acct_settings["delete"]; |
|---|
| | 528 | $display_settings["callmenum"] = $acct_settings["callmenum"]; |
|---|
| | 529 | $opt_headings = $display_settings; |
|---|
| | 530 | $opt_headings["pwd"] = _("Voicemail Password"); |
|---|
| | 531 | $opt_headings["email"] = _("Email Address"); |
|---|
| | 532 | $opt_headings["pager"] = _("Pager Email Address"); |
|---|
| | 533 | $opt_headings["attach"] = _("Email Attachment"); |
|---|
| | 534 | $opt_headings["saycid"] = _("Play CID"); |
|---|
| | 535 | $opt_headings["envelope"] = _("Play Envelope"); |
|---|
| | 536 | $opt_headings["delete"] = _("Delete Voicemail"); |
|---|
| | 537 | $opt_headings["callmenum"] = _("Call-Me Number"); |
|---|
| | 538 | } |
|---|
| | 539 | $output .= $acct_title_links . $display_name_row; |
|---|
| | 540 | |
|---|
| | 541 | |
|---|
| | 542 | foreach ($display_settings as $key => $descrip) { |
|---|
| | 543 | $tooltip = isset($display_tips[$key])?$display_tips[$key]:""; |
|---|
| | 544 | $len = ($descrip["len"] > 0)?$descrip["len"]:$dlen; |
|---|
| | 545 | $id = $id_prefix . "__" . $key; |
|---|
| | 546 | if (isset($settings[$key]) || ($version >= $descrip["ver"])) { |
|---|
| | 547 | $val = isset($settings[$key])?$settings[$key]:""; |
|---|
| | 548 | unset($settings[$key]); |
|---|
| | 549 | $opt_name = ($action == "bsettings")?$opt_headings[$key]:$key; |
|---|
| | 550 | $output .= "<tr><td><a href='#' class='info'>$opt_name<span>$tooltip</span></a></td>"; |
|---|
| | 551 | /* check box or not */ |
|---|
| | 552 | if ($descrip["type"] == "flag") { |
|---|
| | 553 | switch ($val) { |
|---|
| | 554 | case "yes": |
|---|
| | 555 | $yes_selected = "checked=checked"; |
|---|
| | 556 | $no_selected = ""; |
|---|
| | 557 | $undef_selected = ""; |
|---|
| | 558 | break; |
|---|
| | 559 | case "no": |
|---|
| | 560 | $yes_selected = ""; |
|---|
| | 561 | $no_selected = "checked=checked"; |
|---|
| | 562 | $undef_selected = ""; |
|---|
| | 563 | break; |
|---|
| | 564 | default: |
|---|
| | 565 | $yes_selected = ""; |
|---|
| | 566 | $no_selected = ""; |
|---|
| | 567 | $undef_selected = "checked=checked"; |
|---|
| | 568 | break; |
|---|
| 98 | | // Get mailbox settings. |
|---|
| 99 | | $vmbox = null; |
|---|
| 100 | | if ($extens === NULL) { |
|---|
| 101 | | $page_output = "<div class='content'> |
|---|
| 102 | | <BR/>$output_buf<BR/> |
|---|
| 103 | | <h2>" . _("Voicemail") . "</h2> |
|---|
| 104 | | <h3>No voicemail users are defined on this system.</h3>"; |
|---|
| 105 | | } |
|---|
| 106 | | else { |
|---|
| 107 | | $vmbox = voicemail_mailbox_get($extension); |
|---|
| 108 | | if ($vmbox !== null) { |
|---|
| 109 | | $status_enabled = "selected"; |
|---|
| 110 | | $status_disabled = ""; |
|---|
| 111 | | } else { |
|---|
| 112 | | $status_enabled = ""; |
|---|
| 113 | | $status_disabled = "selected"; |
|---|
| 114 | | } |
|---|
| 115 | | $context = isset($vmbox["vmcontext"])?$vmbox["vmcontext"]:"default"; |
|---|
| 116 | | $pwd = isset($vmbox["pwd"])?$vmbox["pwd"]:""; |
|---|
| 117 | | $name = (isset($vmbox["name"]) && $vmbox["name"] != "")?$vmbox["name"]:""; |
|---|
| 118 | | if ($name == "") { |
|---|
| 119 | | $this_exten = core_users_get($extension); |
|---|
| 120 | | $name = $this_exten["name"]; |
|---|
| 121 | | } |
|---|
| 122 | | $email = isset($vmbox["email"])?$vmbox["email"]:""; |
|---|
| 123 | | $pager = isset($vmbox["pager"])?$vmbox["pager"]:""; |
|---|
| 124 | | $options = isset($vmbox["options"])?$vmbox["options"]:array(); |
|---|
| 125 | | if ($options !== NULL) { |
|---|
| 126 | | if (isset($options["attach"])) { |
|---|
| 127 | | if ($options["attach"] == "yes") { |
|---|
| 128 | | $yes_attach = "checked=checked"; |
|---|
| 129 | | $no_attach = ""; |
|---|
| 130 | | } else { |
|---|
| 131 | | $yes_attach = ""; |
|---|
| 132 | | $no_attach = "checked=checked"; |
|---|
| 133 | | } |
|---|
| 134 | | } else { |
|---|
| 135 | | $yes_attach = ""; |
|---|
| 136 | | $no_attach = "checked=checked"; |
|---|
| 137 | | } |
|---|
| 138 | | if (isset($options["saycid"])) { |
|---|
| 139 | | if ($options["saycid"] == "yes") { |
|---|
| 140 | | $yes_cid = "checked=checked"; |
|---|
| 141 | | $no_cid = ""; |
|---|
| 142 | | } else { |
|---|
| 143 | | $yes_cid = ""; |
|---|
| 144 | | $no_cid = "checked=checked"; |
|---|
| 145 | | } |
|---|
| 146 | | } else { |
|---|
| 147 | | $yes_cid = ""; |
|---|
| 148 | | $no_cid = "checked=checked"; |
|---|
| 149 | | } |
|---|
| 150 | | if (isset($options["envelope"])) { |
|---|
| 151 | | if ($options["envelope"] == "yes") { |
|---|
| 152 | | $yes_envelope = "checked=checked"; |
|---|
| 153 | | $no_envelope = ""; |
|---|
| 154 | | } else { |
|---|
| 155 | | $yes_envelope = ""; |
|---|
| 156 | | $no_envelope = "checked=checked"; |
|---|
| 157 | | } |
|---|
| 158 | | } else { |
|---|
| 159 | | $yes_envelope = ""; |
|---|
| 160 | | $no_envelope = "checked=checked"; |
|---|
| 161 | | } |
|---|
| 162 | | if (isset($options["delete"])) { |
|---|
| 163 | | if ($options["delete"] == "yes") { |
|---|
| 164 | | $yes_delete = "checked=checked"; |
|---|
| 165 | | $no_delete = ""; |
|---|
| 166 | | } else { |
|---|
| 167 | | $yes_delete = ""; |
|---|
| 168 | | $no_delete = "checked=checked"; |
|---|
| 169 | | } |
|---|
| 170 | | } else { |
|---|
| 171 | | $yes_delete = ""; |
|---|
| 172 | | $no_delete = "checked=checked"; |
|---|
| 173 | | } |
|---|
| 174 | | $opts = ""; |
|---|
| 175 | | if (isset($options) && is_array($options)) { |
|---|
| 176 | | $alloptions = array_keys($options); |
|---|
| 177 | | if (isset($alloptions)) { |
|---|
| 178 | | foreach ($alloptions as $opt) { |
|---|
| 179 | | if (($opt != "attach") && ($opt != "envelope") && ($opt != "saycid") && ($opt != "delete") && ($opt != "")) { |
|---|
| 180 | | $opts .= $opt . "=" . $options[$opt] . "|"; |
|---|
| 181 | | } |
|---|
| 182 | | } |
|---|
| 183 | | $opts = rtrim($opts, "|"); |
|---|
| 184 | | // remove the = if no options were set. |
|---|
| 185 | | $opts = rtrim($opts, "="); |
|---|
| 186 | | } |
|---|
| 187 | | } |
|---|
| 188 | | } |
|---|
| 189 | | |
|---|
| 190 | | $js_functions = "<script type='text/javascript'><!-- |
|---|
| 191 | | function frm_vmailedit_voicemailEnabled(notused) { |
|---|
| 192 | | |
|---|
| 193 | | if (document.getElementById('vm').value == 'disabled') { |
|---|
| 194 | | var dval=true; |
|---|
| 195 | | } else { |
|---|
| 196 | | var dval=false; |
|---|
| 197 | | } |
|---|
| 198 | | document.getElementById('vmpwd').disabled=dval; |
|---|
| 199 | | document.getElementById('email').disabled=dval; |
|---|
| 200 | | document.getElementById('pager').disabled=dval; |
|---|
| 201 | | document.getElementById('attach0').disabled=dval; |
|---|
| 202 | | document.getElementById('attach1').disabled=dval; |
|---|
| 203 | | document.getElementById('saycid0').disabled=dval; |
|---|
| 204 | | document.getElementById('saycid1').disabled=dval; |
|---|
| 205 | | document.getElementById('envelope0').disabled=dval; |
|---|
| 206 | | document.getElementById('envelope1').disabled=dval; |
|---|
| 207 | | document.getElementById('delete0').disabled=dval; |
|---|
| 208 | | document.getElementById('delete1').disabled=dval; |
|---|
| 209 | | document.getElementById('options').disabled=dval; |
|---|
| 210 | | document.getElementById('vmcontext').disabled=dval; |
|---|
| 211 | | return true; |
|---|
| 212 | | } |
|---|
| 213 | | //--></script>"; |
|---|
| 214 | | |
|---|
| 215 | | $status_html = "<tr><td>Status</td>"; |
|---|
| 216 | | $status_html .= "<td><select name='vm' id='vm' tabindex=1 onchange='frm_vmailedit_voicemailEnabled();'>"; |
|---|
| 217 | | $status_html .= "<option value='enabled' " . $status_enabled . ">Enabled</option>"; |
|---|
| 218 | | $status_html .= "<option value='disabled' " . $status_disabled . ">Disabled</option>"; |
|---|
| 219 | | $status_html .= "</select></td></tr>"; |
|---|
| 220 | | |
|---|
| 221 | | $pwd_html = "<tr><td><a href='#' class='info'> |
|---|
| 222 | | Voicemail Password<span>This is the password used to access the voicemail system. |
|---|
| 223 | | <br /><br />This password can only contain numbers. |
|---|
| 224 | | <br /><br />A user can change the password you enter here after logging into the voicemail system (*98) with a phone. |
|---|
| 225 | | </span></a></td> |
|---|
| 226 | | <td> |
|---|
| 227 | | <input type='password' name='vmpwd' id='vmpwd' tabindex=1 value='" . $pwd . "'></td></tr>"; |
|---|
| 228 | | |
|---|
| 229 | | $email_html = "<tr> |
|---|
| 230 | | <td><a href='#' class='info'>Email Address<span>The email address that voicemails are sent to.</span></a></td> |
|---|
| 231 | | <td><input type='text' name='email' id='email' tabindex=1 value='" . $email . "'></td></tr>"; |
|---|
| 232 | | |
|---|
| 233 | | $pager_html = "<tr> |
|---|
| 234 | | <td><a href='#' class='info'>Pager Email Address<span>Pager/mobile email address that short voicemail notifications are sent to.</span></a></td> |
|---|
| 235 | | <td><input type='text' name='pager' id='pager' tabindex=1 value='" . $pager . "'></td></tr>"; |
|---|
| 236 | | |
|---|
| 237 | | $att_html = "<tr><td><a href='#' class='info'>Email Attachment<span>Option to attach voicemails to email.</span></a></td> |
|---|
| 238 | | <td><input type='radio' name='attach' id='attach0' tabindex=1 value='attach=yes' " . $yes_attach . " />yes |
|---|
| 239 | | <input type='radio' name='attach' id='attach1' tabindex=1 value='attach=no' " . $no_attach . "/>no </td></tr>"; |
|---|
| 240 | | |
|---|
| 241 | | $cid_html = "<tr> |
|---|
| 242 | | <td><a href='#' class='info'>Play CID<span>Read back caller's telephone number prior to playing the incoming message, and just after announcing the date and time the message was left.</span></a></td> |
|---|
| 243 | | <td><input type='radio' name='saycid' id='saycid0' tabindex=1 value='saycid=yes' " . $yes_cid . " />yes |
|---|
| 244 | | <input type='radio' name='saycid' id='saycid1' tabindex=1 value='saycid=no' " . $no_cid . " />no </td></tr>"; |
|---|
| 245 | | |
|---|
| 246 | | $envelope_html = "<tr> |
|---|
| 247 | | <td><a href='#' class='info'>Play Envelope<span>Envelope controls whether or not the voicemail system will play the message envelope (date/time) before playing the voicemail message. This setting does not affect the operation of the envelope option in the advanced voicemail menu.</span></a></td> |
|---|
| 248 | | <td><input type='radio' name='envelope' id='envelope0' tabindex=1 value='envelope=yes' " . $yes_envelope . " />yes |
|---|
| 249 | | <input type='radio' name='envelope' id='envelope1' tabindex=1 value='envelope=no' " . $no_envelope . " />no </td></tr>"; |
|---|
| 250 | | |
|---|
| 251 | | $delete_html = "<tr> |
|---|
| 252 | | <td><a href='#' class='info'>Delete Voicemail<span>If set to \"yes\" the message will be deleted from the voicemailbox (after having been emailed). Provides functionality that allows a user to receive their voicemail via email alone, rather than having the voicemail able to be retrieved from the Webinterface or the Extension handset. CAUTION: MUST HAVE attach voicemail to email SET TO YES OTHERWISE YOUR MESSAGES WILL BE LOST FOREVER.</span></a></td> |
|---|
| 253 | | <td><input type='radio' name='delete' id='delete0' tabindex=1 value='delete=yes' " . $yes_delete . " />yes |
|---|
| 254 | | <input type='radio' name='delete' id='delete1' tabindex=1 value='delete=no' " . $no_delete . " />no </td></tr>"; |
|---|
| 255 | | |
|---|
| 256 | | $opts_html = "<tr> |
|---|
| 257 | | <td><a href='#' class='info'>VM Options<span>Separate options with pipe ( | )<br /><br />ie: review=yes|maxmessage=60</span></a></td> |
|---|
| 258 | | <td><input type='text' name='options' id='options' tabindex=1 value='" . $opts . "'></td></tr>"; |
|---|
| 259 | | |
|---|
| 260 | | $context_html = "<tr> |
|---|
| 261 | | <td><a href='#' class='info'>VM Context<span>This is the Voicemail Context which is normally set to default. Do not change unless you understand the implications.</span></a></td> |
|---|
| 262 | | <td><input type='text' name='vmcontext' id='vmcontext' tabindex=1 value='" . $context . "'></td></tr>"; |
|---|
| 263 | | |
|---|
| 264 | | |
|---|
| 265 | | $submit_html = "<tr><td><h6><input name='Submit' type='submit' tabindex='1' value='Submit'></h6></td>"; |
|---|
| 266 | | if ($update_flag == "true") { |
|---|
| 267 | | $submit_html .= "<td><b>Settings update complete.</b></td>"; |
|---|
| 268 | | } |
|---|
| 269 | | $submit_html .= "</tr>"; |
|---|
| 270 | | |
|---|
| 271 | | $table_output = $status_html . $pwd_html . $name_html . $email_html . $pager_html . $att_html . $cid_html . $envelope_html . $delete_html . $opts_html . $context_html . $submit_html; |
|---|
| 272 | | |
|---|
| 273 | | $page_output = "<div class='content'> |
|---|
| 274 | | <BR/>$output_buf<BR/> |
|---|
| 275 | | <h2>" . _("Voicemail: $extension $name") . "</h2> |
|---|
| 276 | | <form autocomplete='off' name='ampuserVoicemailEdit' action='config.php' method='post'> |
|---|
| 277 | | <input type='hidden' name='update_flag' value='true'/> |
|---|
| 278 | | <input type='hidden' name='display' value='$display'/> |
|---|
| 279 | | <input type='hidden' name='action' id='action' value='changevmailsettings'/> |
|---|
| 280 | | <input type='hidden' name='extension' id='extension' value='$extension'/> |
|---|
| 281 | | <input type='hidden' name='extdisplay' id='extdisplay' value='$extension'/> |
|---|
| 282 | | <input type='hidden' name='name' id='name' value='$name'> |
|---|
| 283 | | <table>$table_output</table> |
|---|
| 284 | | </form> |
|---|
| 285 | | $js_functions |
|---|
| 286 | | <script type='text/javascript'>frm_vmailedit_voicemailEnabled();</script>"; |
|---|
| 287 | | } |
|---|
| 288 | | echo $page_output; |
|---|
| | 718 | |
|---|
| | 719 | $output .= "</table>"; |
|---|
| | 720 | $output .= "</form>"; |
|---|
| | 721 | |
|---|
| | 722 | echo $output; |
|---|