root/freepbx/trunk/libfreepbx.install.php

Revision 14351, 92.2 kB (checked in by p_lindheimer, 8 months ago)

Merged revisions 14295,14314,14324 via svnmerge from
http://www.freepbx.org/v2/svn/freepbx/branches/2.10

........

r14295 | p_lindheimer | 2012-08-28 13:47:32 -0700 (Tue, 28 Aug 2012) | 1 line


closes #5969 adds spliceInclude allowing specific placement of an include prior to an existing one

........

r14314 | GameGamer?43 | 2012-09-05 16:14:23 -0700 (Wed, 05 Sep 2012) | 1 line


closes #5933 - allow extensions numbered zero to be edited, by doing a proper check on extdisplay

........

r14324 | mbrevda | 2012-09-19 05:25:54 -0700 (Wed, 19 Sep 2012) | 1 line


re #5989 - use dirname instead of _ENV

........

  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 //This file is part of FreePBX.
3 //
4 //    FreePBX is free software: you can redistribute it and/or modify
5 //    it under the terms of the GNU General Public License as published by
6 //    the Free Software Foundation, either version 2 of the License, or
7 //    (at your option) any later version.
8 //
9 //    FreePBX is distributed in the hope that it will be useful,
10 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //    GNU General Public License for more details.
13 //
14 //    You should have received a copy of the GNU General Public License
15 //    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>.
16 //
17 //    Copyright 2007, Philippe Lindheimer
18 //
19
20 /********************************************************************************************************************/
21 /* freepbxlib.install.php
22  *
23  * These are used by install_amp and the framework install script to run updates
24  *
25  * These variables are required to be defined outside of this library. The purpose
26  * of this is to allow the library to be used by both install_amp as well as the
27  * framework which would potentially be accessing these from different locations.
28  *
29  * Examples:
30  *
31  * UPGRADE_DIR     dirname(__FILE__)."/upgrades"
32  * MODULE_DIR      dirname(__FILE__)."/amp_conf/htdocs/admin/modules/"
33  *
34  * or (in framework for instance)
35  *
36  * MODULE_DIR      dirname(__FILE__)."/htdocs/admin/modules/"
37  *
38  * $debug = false;
39  * $dryrun = false;
40  */
41
42 function upgrade_all($version) {
43
44   // **** Read upgrades/ directory
45
46   outn("Checking for upgrades..");
47
48   // read versions list from upgrades/
49   $versions = array();
50   $dir = opendir(UPGRADE_DIR);
51   while ($file = readdir($dir)) {
52     if (($file[0] != ".") && is_dir(UPGRADE_DIR."/".$file)) {
53       $versions[] = $file;
54     }
55   }
56   closedir($dir);
57
58   // callback to use php's version_compare() to sort
59   usort($versions, "version_compare_freepbx");
60
61
62   // find versions that are higher than the current version
63   $starting_version = false;
64   foreach ($versions as $check_version) {
65     if (version_compare_freepbx($check_version, $version) > 0) { // if check_version < version
66       $starting_version = $check_version;
67       break;
68     }
69   }
70
71   // run all upgrades from the list of higher versions
72   if ($starting_version) {
73     $pos = array_search($starting_version, $versions);
74     $upgrades = array_slice($versions, $pos); // grab the list of versions, starting at $starting_version
75     out(count($upgrades)." found");
76     run_upgrade($upgrades);
77
78     /* Set the base version of key modules, currently core and framework, to the
79      * Version packaged with this tarball, if any. The expectation is that the
80      * packaging scripts will make these module version numbers the same as the
81      * release plus a '.0' which can be incremented for bug fixes delivered through
82      * the online system between main releases.
83      *
84      * added if function_exists because if this is being run from framework there is no
85      * need to reset the base version.
86      */
87     if (function_exists('set_base_version')) {
88       set_base_version();
89     }
90
91   } else {
92     out("No further upgrades necessary");
93   }
94
95 }
96
97 //----------------------------------
98 // dependencies for upgrade_all
99
100
101 /** Invoke upgrades
102  * @param $versions array The version upgrade scripts to run
103  */
104 function run_upgrade($versions) {
105   global $dryrun;
106  
107   foreach ($versions as $version) {
108     out("Upgrading to ".$version."..");
109     install_upgrade($version);
110     if (!$dryrun) {
111       setversion($version);
112     }
113     out("Upgrading to ".$version."..OK");
114   }
115 }
116
117 //get the version number
118 function install_getversion() {
119   global $db;
120   $sql = "SELECT value FROM admin WHERE variable = 'version'";
121   $results = $db->getAll($sql);
122   if(DB::IsError($results)) {
123     return false;
124   }
125   return $results[0][0];
126 }
127
128 //set the version number
129 function setversion($version) {
130   global $db;
131   $sql = "UPDATE admin SET value = '".$version."' WHERE variable = 'version'";
132   debug($sql);
133   $result = $db->query($sql);
134   if(DB::IsError($result)) {     
135     die($result->getMessage());
136   }
137 }
138
139 /** Install a particular version
140  */
141 function install_upgrade($version) {
142   global $db;
143   global $dryrun;
144   global $amp_conf;
145  
146   $db_engine = $amp_conf["AMPDBENGINE"];
147  
148   if (is_dir(UPGRADE_DIR."/".$version)) {
149     // sql scripts first
150     $dir = opendir(UPGRADE_DIR."/".$version);
151     while ($file = readdir($dir)) {
152       if (($file[0] != ".") && is_file(UPGRADE_DIR."/".$version."/".$file)) {
153         if ( (strtolower(substr($file,-4)) == ".sqlite") && ($db_engine == "sqlite") ) {
154           install_sqlupdate( $version, $file );
155         }
156         elseif ((strtolower(substr($file,-4)) == ".sql") &&
157             ( ($db_engine  == "mysql")  ||  ($db_engine  == "pgsql") || ($db_engine == "sqlite3") ) ) {
158           install_sqlupdate( $version, $file );
159         }
160       }
161     }
162
163                 // now non sql scripts
164                 $dir = opendir(UPGRADE_DIR."/".$version);
165                 while ($file = readdir($dir)) {
166                         if (($file[0] != ".") && is_file(UPGRADE_DIR."/".$version."/".$file)) {
167                                 if ((strtolower(substr($file,-4)) == ".sql") || (strtolower(substr($file,-7)) == ".sqlite")) {
168                                         // sql scripts were dealt with first
169                                 } else if (strtolower(substr($file,-4)) == ".php") {
170                                         out("-> Running PHP script ".UPGRADE_DIR."/".$version."/".$file);
171                                         if (!$dryrun) {
172                                                 run_included(UPGRADE_DIR."/".$version."/".$file);
173                                         }
174
175                                 } else if (is_executable(UPGRADE_DIR."/".$version."/".$file)) {
176                                         out("-> Executing ".UPGRADE_DIR."/".$version."/".$file);
177                                         if (!$dryrun) {
178                                                 exec(UPGRADE_DIR."/".$version."/".$file);
179                                         }
180                                 } else {
181                                         error("-> Don't know what to do with ".UPGRADE_DIR."/".$version."/".$file);
182                                 }
183                         }
184                 }
185
186   }
187 }
188
189
190 function checkDiff($file1, $file2) {
191   // diff, ignore whitespace and be quiet
192   exec("diff -wq ".escapeshellarg($file2)." ".escapeshellarg($file1), $output, $retVal);
193   return ($retVal != 0);
194 }
195
196 function amp_mkdir($directory, $mode = "0755", $recursive = false) {
197   global $runas_uid;
198   global $runas_gid;
199   debug("mkdir ".$directory.", ".$mode);
200   $ntmp = sscanf($mode,"%o",$modenum); //assumes all inputs are octal
201   if (version_compare(phpversion(), '5.0') < 0) {
202     // php <5 can't recursively create directories
203     if ($recursive) {
204       $output = false;
205       $return_value = false;
206       exec("mkdir -m ".$mode." -p ".$directory,  $output, $return_value);
207       exec("chown -R $runas_uid:$runas_gid $directory");
208       return ($return_value == 0);
209     } else {
210       $ret=mkdir($directory, $modenum);
211       exec("chown -R $runas_uid:$runas_gid $directory");
212       return $ret;
213     }
214   } else {
215     $ret=mkdir($directory, $modenum, $recursive);
216     exec("chown -R $runas_uid:$runas_gid $directory");
217     return $ret;
218   }
219 }
220
221 /** Recursively copy a directory
222  */
223 function recursive_copy($dirsourceparent, $dirdest, &$md5sums, $dirsource = "") {
224   global $dryrun;
225   global $check_md5s;
226   global $amp_conf;
227   global $asterisk_conf;
228   global $install_moh;
229   global $make_links;
230
231   $moh_subdir = isset($amp_conf['MOHDIR']) ? trim(trim($amp_conf['MOHDIR']),'/') : 'mohmp3';
232
233   // total # files, # actually copied
234   $num_files = $num_copied = 0;
235  
236   if ($dirsource && ($dirsource[0] != "/")) $dirsource = "/".$dirsource;
237  
238   if (is_dir($dirsourceparent.$dirsource)) $dir_handle = opendir($dirsourceparent.$dirsource);
239  
240   /*
241   echo "dirsourceparent: "; var_dump($dirsourceparent);
242   echo "dirsource: "; var_dump($dirsource);
243   echo "dirdest: "; var_dump($dirdest);
244   */
245  
246   while (isset($dir_handle) && ($file = readdir($dir_handle))) {
247     if (($file!=".") && ($file!="..") && ($file != "CVS") && ($file != ".svn")) {
248       $source = $dirsourceparent.$dirsource."/".$file;
249       $destination =  $dirdest.$dirsource."/".$file;
250      
251       if ($dirsource == "" && $file == "moh" && !$install_moh) {
252         // skip to the next dir
253         continue;
254       }
255
256      
257       // configurable in amportal.conf
258       $destination=str_replace("/htdocs",trim($amp_conf["AMPWEBROOT"]),$destination);
259       if(strpos($dirsource, 'modules') === false) $destination=str_replace("/bin",trim($amp_conf["AMPBIN"]),$destination);
260       $destination=str_replace("/sbin",trim($amp_conf["AMPSBIN"]),$destination);
261      
262       // the following are configurable in asterisk.conf
263       $destination=str_replace("/astetc",trim($asterisk_conf["astetcdir"]),$destination);
264       $destination=str_replace("/moh",trim($asterisk_conf["astvarlibdir"])."/$moh_subdir",$destination);
265       $destination=str_replace("/astvarlib",trim($asterisk_conf["astvarlibdir"]),$destination);
266       if(strpos($dirsource, 'modules') === false) $destination=str_replace("/agi-bin",trim($asterisk_conf["astagidir"]),$destination);
267       if(strpos($dirsource, 'modules') === false) $destination=str_replace("/sounds",trim($asterisk_conf["astvarlibdir"])."/sounds",$destination);
268
269       // if this is a directory, ensure destination exists
270       if (is_dir($source)) {
271         if (!file_exists($destination)) {
272           if ((!$dryrun) && ($destination != "")) {
273             amp_mkdir($destination, "0750", true);
274           }
275         }
276       }
277      
278       //var_dump($md5sums);
279       if (!is_dir($source)) {
280         $md5_source = preg_replace("|^/?amp_conf/|", "/", $source);
281
282         if ($check_md5s && file_exists($destination) && isset($md5sums[$md5_source]) && (md5_file($destination) != $md5sums[$md5_source])) {
283           // double check using diff utility (and ignoring whitespace)
284           // This is a somewhat edge case (eg, the file doesn't match
285           // it's md5 sum from the previous version, but no substantial
286           // changes exist compared to the current version), but it
287           // prevents a useless prompt to the user.
288           if (checkDiff($source, $destination)) {
289             $overwrite = ask_overwrite($source, $destination);
290           } else {
291             debug("NOTE: MD5 for ".$destination." was different, but `diff` did not detect any (non-whitespace) changes: overwriting");
292             $overwrite = true;
293           }
294         } else {
295           $overwrite = true;
296         }
297        
298         // These are modified by apply_conf.sh, there may be others that fit in this category also. This keeps these from
299         // being symlinked and then developers inadvertently checking in the changes when they should not have.
300         //
301         $never_symlink = array("cdr_mysql.conf", "manager.conf", "vm_email.inc");
302
303         $num_files++;
304         if ($overwrite) {
305           debug(($make_links ? "link" : "copy")." ".$source." -> ".$destination);
306           if (!$dryrun) {
307             if ($make_links && !in_array(basename($source),$never_symlink)) {
308               // symlink, unlike copy, doesn't overwrite - have to delete first
309               if (is_link($destination) || file_exists($destination)) {
310                 unlink($destination);
311               }
312               symlink(dirname(__FILE__)."/".$source, $destination);
313             } else {
314               copy($source, $destination);
315             }
316             $num_copied++;
317           }
318         } else {
319           debug("not overwriting ".$destination);
320         }
321       } else {
322         //echo "recursive_copy($dirsourceparent, $dirdest, $md5sums, $dirsource/$file)";
323         list($tmp_num_files, $tmp_num_copied) = recursive_copy($dirsourceparent, $dirdest, $md5sums, $dirsource."/".$file);
324         $num_files += $tmp_num_files;
325         $num_copied += $tmp_num_copied;
326       }
327     }
328   }
329  
330   if (isset($dir_handle)) closedir($dir_handle);
331  
332   return array($num_files, $num_copied);
333 }
334
335 function read_md5_file($filename) {
336   $md5 = array();
337   if (file_exists($filename)) {
338     foreach (file($filename) as $line) {
339       if (preg_match("/^([a-f0-9]{32})\s+(.*)$/", $line, $matches)) {
340         $md5[ "/".$matches[2] ] = $matches[1];
341       }
342     }
343   }
344   return $md5;
345 }
346
347 /** Include a .php file
348  * This is a function just to keep a separate context
349  */
350 function run_included($file) {
351   global $db;
352   global $amp_conf;
353  
354   include($file);
355 }
356
357 function install_sqlupdate( $version, $file )
358 {
359   global $db;
360   global $dryrun;
361
362   out("-> Running SQL script ".UPGRADE_DIR."/".$version."/".$file);
363   // run sql script
364   $fd = fopen(UPGRADE_DIR."/".$version."/".$file, "r");
365   $data = "";
366   while (!feof($fd)) {
367     $data .= fread($fd, 1024);
368   }
369   fclose($fd);
370
371   preg_match_all("/((SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER).*);\s*\n/Us", $data, $matches);
372  
373   foreach ($matches[1] as $sql) {
374     debug($sql);
375     if (!$dryrun) {
376       $result = $db->query($sql);
377       if(DB::IsError($result)) {     
378         fatal($result->getDebugInfo()."\" while running ".$file."\n");
379       }
380     }
381   }
382 }
383
384 /********************************************************************************************************************/
385 /*                          FREEPBX SETTINGS (AMPORTAL.CONF) DEFINED HERE                                           */
386 /********************************************************************************************************************/
387 //
388 // TODO: find a good way to extract the required localization strings for the tools to pickup
389 //
390 // freepbx_settings_init()
391 // this is where we initialize all the freepbx_settings (amportal.conf). This will be run with install_amp and every
392 // time we run the framework installer, so new settings can be added here that are framework wide. It may make send to
393 // break this out separately but for now we'll keep it here since this is already part of the infrastructure that is
394 // used by both install_amp and the framework install/upgrade script.
395 //
396 function freepbx_settings_init($commit_to_db = false) {
397   global $amp_conf;
398
399   if (!class_exists('freepbx_conf')) {
400     include_once ($amp_conf['AMPWEBROOT'].'/admin/libraries/freepbx_conf.class.php');
401   }
402
403   $freepbx_conf =& freepbx_conf::create();
404
405   $set['value'] = '';
406   $set['defaultval'] =& $set['value'];
407   $set['readonly'] = 0;
408   $set['hidden'] = 0;
409   $set['level'] = 0;
410   $set['module'] = '';
411   $set['emptyok'] = 0;
412
413
414   //
415   // CATEGORY: Advanced Settings Display
416   //
417   $set['category'] = 'Advanced Settings Details';
418
419   /* This was too confusing, will remove for now and re-evaluate if needed
420   // AS_DISPLAY_DETAIL_LEVEL
421   $set['value'] = '0';
422   $set['options'] = '0,1,2,3,4,5,6,7,8,9,10';
423   $set['name'] = 'Display Detail Level';
424   $set['description'] = 'This will filter which settings that are displayed on this Advanced Settings page. The higher the level, the more obscure settings will be shown. Settings at higher levels are unlikely to be of interest to most users and could be more volatile to breaking your system if set wrong.';
425   $set['emptyok'] = 0;
426   $set['level'] = 0;
427   $set['readonly'] = 0;
428   $set['type'] = CONF_TYPE_SELECT;
429   $freepbx_conf->define_conf_setting('AS_DISPLAY_DETAIL_LEVEL',$set);
430   $set['readonly'] = 0;
431   $set['level'] = 0;
432   */
433
434   // AS_DISPLAY_HIDDEN_SETTINGS
435   $set['value'] = false;
436   $set['options'] = '';
437   $set['name'] = 'Display Hidden Settings';
438   $set['description'] = 'This will display settings that are normally hidden by the system. These settings are often internally used settings that are not of interest to most users.';
439   $set['emptyok'] = 0;
440   $set['level'] = 0;
441   $set['readonly'] = 0;
442   $set['type'] = CONF_TYPE_BOOL;
443   $freepbx_conf->define_conf_setting('AS_DISPLAY_HIDDEN_SETTINGS',$set);
444   $set['readonly'] = 0;
445   $set['level'] = 0;
446
447   // AS_DISPLAY_READONLY_SETTINGS
448   $set['value'] = false;
449   $set['options'] = '';
450   $set['name'] = 'Display Readonly Settings';
451   $set['description'] = 'This will display settings that are readonly. These settings are often internally used settings that are not of interest to most users. Since they are readonly they can only be viewed.';
452   $set['emptyok'] = 0;
453   $set['level'] = 0;
454   $set['readonly'] = 0;
455   $set['type'] = CONF_TYPE_BOOL;
456   $freepbx_conf->define_conf_setting('AS_DISPLAY_READONLY_SETTINGS',$set);
457   $set['readonly'] = 0;
458   $set['level'] = 0;
459
460   // AS_OVERRIDE_READONLY
461   $set['value'] = false;
462   $set['options'] = '';
463   $set['name'] = 'Override Readonly Settings';
464   $set['description'] = 'Setting this to true will allow you to override un-hidden readonly setting to change them. Settings that are readonly may be extremely volatile and have a high chance of breaking your system if you change them. Take extreme caution when electing to make such changes.';
465   $set['emptyok'] = 0;
466   $set['level'] = 0;
467   $set['readonly'] = 0;
468   $set['type'] = CONF_TYPE_BOOL;
469   $freepbx_conf->define_conf_setting('AS_OVERRIDE_READONLY',$set);
470   $set['readonly'] = 0;
471   $set['level'] = 0;
472
473   // AS_DISPLAY_FRIENDLY_NAME
474   $set['value'] = true;
475   $set['options'] = '';
476   $set['name'] = 'Display Friendly Name';
477   $set['description'] = 'Normally the friendly names will be displayed on this page and the internal freepbx_conf configuration names are shown in the tooltip. If you prefer to view the configuration variables, and the friendly name in the tooltip, set this to false..';
478   $set['emptyok'] = 0;
479   $set['level'] = 0;
480   $set['readonly'] = 0;
481   $set['type'] = CONF_TYPE_BOOL;
482   $freepbx_conf->define_conf_setting('AS_DISPLAY_FRIENDLY_NAME',$set);
483   $set['readonly'] = 0;
484   $set['level'] = 0;
485
486   //
487   // CATEGORY: System Setup
488   //
489   $set['category'] = 'System Setup';
490
491   // AMPSYSLOGLEVEL
492   $set['value'] = 'FILE';
493   $set['options'] = 'FILE, LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG';
494   // LOG_SQL, SQL are discontinued, they are removed during migration if the slipped in and in core if it were to persist because amportal.conf was not
495   // writeable for a while.
496   //
497   if (isset($amp_conf['AMPSYSLOGLEVEL']) && (strtoupper($amp_conf['AMPSYSLOGLEVEL']) == 'SQL' || strtoupper($amp_conf['AMPSYSLOGLEVEL']) == 'LOG_SQL')) {
498     $set['options'] .= ', LOG_SQL, SQL';
499   }
500   $set['name'] = 'FreePBX Log Routing';
501   $set['description'] = "Determine where to send log information if the log is enabled ('Disable FreePBX Log' (AMPDISABLELOG) false. There are two places to route the log messages. 'FILE' will send all log messages to the defined 'FreePBX Log File' (FPBX_LOG_FILE). All the other settings will route the log messages to your System Logging subsystem (syslog) using the specified log level. Syslog can be configured to route different levels to different locations. See 'syslog' documentation (man syslog) on your system for more details.";
502   $set['emptyok'] = 0;
503   $set['readonly'] = 0;
504   $set['sortorder'] = -190;
505   $set['type'] = CONF_TYPE_SELECT;
506   $freepbx_conf->define_conf_setting('AMPSYSLOGLEVEL',$set);
507
508   // AMPDISABLELOG
509   $set['value'] = false;
510   $set['options'] = '';
511   $set['name'] = 'Disable FreePBX Log';
512   $set['description'] = 'Whether or not to invoke the FreePBX log facility.';
513   $set['emptyok'] = 0;
514   $set['readonly'] = 0;
515   $set['sortorder'] = -180;
516   $set['type'] = CONF_TYPE_BOOL;
517   $freepbx_conf->define_conf_setting('AMPDISABLELOG',$set);
518
519   // LOG_OUT_MESSAGES
520   $set['value'] = true;
521   $set['options'] = '';
522   $set['name'] = 'Log Verbose Messages';
523   $set['description'] = 'FreePBX has many verbose and useful messages displayed to users during module installation, system installations, loading configurations and other places. In order to accumulate these messages in the log files as well as the on screen display, set this to true.';
524   $set['emptyok'] = 0;
525   $set['readonly'] = 0;
526   $set['sortorder'] = -170;
527   $set['type'] = CONF_TYPE_BOOL;
528   $freepbx_conf->define_conf_setting('LOG_OUT_MESSAGES',$set);
529
530   // LOG_NOTIFICATIONS
531   $set['value'] = true;
532   $set['options'] = '';
533   $set['name'] = 'Send Dashboard Notifications to Log';
534   $set['description'] = 'When enabled all notification updates to the Dashboard notification panel will also be logged into the specified log file when enabled.';
535   $set['emptyok'] = 0;
536   $set['readonly'] = 0;
537   $set['sortorder'] = -160;
538   $set['type'] = CONF_TYPE_BOOL;
539   $freepbx_conf->define_conf_setting('LOG_NOTIFICATIONS',$set);
540
541   // FPBX_LOG_FILE
542   $set['value'] = $amp_conf['ASTLOGDIR'] . '/freepbx.log';
543   $set['options'] = '';
544   $set['name'] = 'FreePBX Log File';
545   $set['description'] = 'Full path and name of the FreePBX Log File used in conjunction with the Syslog Level (AMPSYSLOGLEVEL) being set to FILE, not used otherwise. Initial installs may have some early logging sent to /tmp/freepbx_pre_install.log when it is first bootstrapping the installer.';
546   $set['emptyok'] = 0;
547   $set['readonly'] = 0;
548   $set['sortorder'] = -150;
549   $set['type'] = CONF_TYPE_TEXT;
550   $freepbx_conf->define_conf_setting('FPBX_LOG_FILE',$set);
551
552   // PHP_ERROR_HANDLER_OUTPUT
553   $set['value'] = 'dbug';
554   $set['options'] = array('dbug','freepbxlog','off');
555   $set['name'] = 'PHP Error Log Output';
556   $set['description'] = "Where to send PHP errors, warnings and notices by the FreePBX PHP error handler. Set to 'dbug', they will go to the Debug File regardless of whether dbug Loggin is disabled or not. Set to 'freepbxlog' will send them to the FreePBX Log. Set to 'off' and they will be ignored.";
557   $set['emptyok'] = 0;
558   $set['readonly'] = 0;
559   $set['sortorder'] = -140;
560   $set['type'] = CONF_TYPE_SELECT;
561   $freepbx_conf->define_conf_setting('PHP_ERROR_HANDLER_OUTPUT',$set);
562
563   // AMPEXTENSIONS
564   $set['value'] = 'extensions';
565   $set['options'] = 'extensions,deviceanduser';
566   $set['name'] = 'User & Devices Mode';
567   $set['description'] = 'Sets the extension behavior in FreePBX.  If set to <b>extensions</b>, Devices and Users are administered together as a unified Extension, and appear on a single page. If set to <b>deviceanduser</b>, Devices and Users will be administered separately. Devices (e.g. each individual line on a SIP phone) and Users (e.g. <b>101</b>) will be configured independent of each other, allowing association of one User to many Devices, or allowing Users to login and logout of Devices.';
568   $set['emptyok'] = 0;
569   $set['readonly'] = 0;
570   $set['sortorder'] = -135;
571   $set['type'] = CONF_TYPE_SELECT;
572   $freepbx_conf->define_conf_setting('AMPEXTENSIONS',$set);
573
574   // AUTHTYPE
575   $set['value'] = 'database';
576   $set['options'] = 'database,none,webserver';
577   $set['name'] = 'Authorization Type';
578   $set['description'] = 'Authentication type to use for web admin. If type set to <b>database</b>, the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above. When using database you can create users that are restricted to only certain module pages. When set to none, you should make sure you have provided security at the apache level. When set to webserver, FreePBX will expect authentication to happen at the apache level, but will take the user credentials and apply any restrictions as if it were in database mode.';
579   $set['emptyok'] = 0;
580   $set['level'] = 3;
581   $set['readonly'] = 1;
582   $set['sortorder'] = -130;
583   $set['type'] = CONF_TYPE_SELECT;
584   $freepbx_conf->define_conf_setting('AUTHTYPE',$set);
585   $set['level'] = 0;
586
587   // AMP_ACCESS_DB_CREDS
588   $set['value'] = false;
589   $set['options'] = '';
590   $set['name'] = 'Allow Login With DB Credentials';
591   $set['description'] = "When Set to True, admin access to the FreePBX GUI will be allowed using the FreePBX configured AMPDBUSER and AMPDBPASS credentials. This only applies when Authorization Type is 'database' mode.";
592   $set['emptyok'] = 0;
593   $set['readonly'] = 0;
594   $set['sortorder'] = -126;
595   $set['type'] = CONF_TYPE_BOOL;
596   $freepbx_conf->define_conf_setting('AMP_ACCESS_DB_CREDS',$set);
597
598   // ARI_ADMIN_USERNAME
599   $set['value'] = '';
600   $set['options'] = '';
601   $set['name'] = 'User Portal Admin Username';
602   $set['description'] = 'This is the default admin name used to allow an administrator to login to ARI bypassing all security. Change this to whatever you want, do not forget to change the User Portal Admin Password as well. Default = not set';
603   $set['emptyok'] = 1;
604   $set['readonly'] = 0;
605   $set['sortorder'] = -120;
606   $set['type'] = CONF_TYPE_TEXT;
607   $freepbx_conf->define_conf_setting('ARI_ADMIN_USERNAME',$set);
608
609   // ARI_ADMIN_PASSWORD
610   $set['value'] = 'ari_password';
611   $set['options'] = '';
612   $set['name'] = 'User Portal Admin Password';
613   $set['description'] = 'This is the default admin password to allow an administrator to login to ARI bypassing all security. Change this to a secure password. Default = not set';
614   $set['emptyok'] = 0;
615   $set['readonly'] = 0;
616   $set['sortorder'] = -110;
617   $set['type'] = CONF_TYPE_TEXT;
618   $freepbx_conf->define_conf_setting('ARI_ADMIN_PASSWORD',$set);
619
620   // FORCED_ASTVERSION
621   $set['value'] = '';
622   $set['options'] = '';
623   $set['name'] = 'Force Asterisk Version';
624   $set['description'] = 'Normally FreePBX gets the current Asterisk version directly from Asterisk. This is required to generate proper dialplan for a given version. When using some custom Asterisk builds, the version may not be properly parsed and improper dialplan generated. Setting this to an equivalent Asterisk version will override what is read from Asterisk. This SHOULD be left blank unless you know what you are doing.';
625   $set['emptyok'] = 1;
626   $set['readonly'] = 1;
627   $set['sortorder'] = -100;
628   $set['type'] = CONF_TYPE_TEXT;
629   $set['level'] = 4;
630   $freepbx_conf->define_conf_setting('FORCED_ASTVERSION',$set);
631   $set['level'] = 0;
632
633   // AMPENGINE
634   $set['value'] = 'asterisk';
635   $set['options'] = 'asterisk';
636   $set['name'] = 'Telephony Engine';
637   $set['description'] = 'The telephony backend engine being used, asterisk is the only option currently.';
638   $set['emptyok'] = 0;
639   $set['level'] = 3;
640   $set['readonly'] = 1;
641   $set['type'] = CONF_TYPE_SELECT;
642   $freepbx_conf->define_conf_setting('AMPENGINE',$set);
643   $set['level'] = 0;
644
645   // AMPVMUMASK
646   $set['value'] = '007';
647   $set['options'] = '';
648   $set['name'] = 'Asterisk VMU Mask';
649   $set['description'] = 'Defaults to 077 allowing only the asterisk user to have any permission on VM files. If set to something like 007, it would allow the group to have permissions. This can be used if setting apache to a different user then asterisk, so that the apache user (and thus ARI) can have access to read/write/delete the voicemail files. If changed, some of the voicemail directory structures may have to be manually changed.';
650   $set['emptyok'] = 0;
651   $set['readonly'] = 0;
652   $set['type'] = CONF_TYPE_TEXT;
653   $set['level'] = 4;
654   $freepbx_conf->define_conf_setting('AMPVMUMASK',$set);
655   $set['level'] = 0;
656
657   // AMPWEBADDRESS
658   $set['value'] = '';
659   $set['options'] = '';
660   $set['name'] = 'FreePBX Web Address';
661   $set['description'] = 'This is the address of your Web Server. It is mostly obsolete and derived when not supplied and will be phased out, but there are still some areas expecting a variable to be set and if you are using it this will migrate your value.';
662   $set['emptyok'] = 1;
663   $set['readonly'] = 0;
664   $set['type'] = CONF_TYPE_TEXT;
665   $set['level'] = 4;
666   $freepbx_conf->define_conf_setting('AMPWEBADDRESS',$set);
667   $set['level'] = 0;
668
669   // AMPASTERISKUSER
670   $set['value'] = 'asterisk';
671   $set['options'] = '';
672   $set['name'] = 'System Asterisk User';
673   $set['description'] = 'The user Asterisk should be running as, used by freepbx_engine. Most systems should not change this.';
674   $set['emptyok'] = 0;
675   $set['type'] = CONF_TYPE_TEXT;
676   $set['level'] = 4;
677   $set['readonly'] = 1;
678   $freepbx_conf->define_conf_setting('AMPASTERISKUSER',$set);
679   $set['level'] = 0;
680
681   // AMPASTERISKGROUP
682   $set['value'] = 'asterisk';
683   $set['options'] = '';
684   $set['name'] = 'System Asterisk Group';
685   $set['description'] = 'The user group Asterisk should be running as, used by freepbx_engine. Most systems should not change this.';
686   $set['emptyok'] = 0;
687   $set['type'] = CONF_TYPE_TEXT;
688   $set['level'] = 4;
689   $set['readonly'] = 1;
690   $freepbx_conf->define_conf_setting('AMPASTERISKGROUP',$set);
691   $set['level'] = 0;
692
693   // AMPASTERISKWEBUSER
694   $set['value'] = 'asterisk';
695   $set['options'] = '';
696   $set['name'] = 'System Web User';
697   $set['description'] = 'The user your httpd should be running as, used by freepbx_engine. Most systems should not change this.';
698   $set['emptyok'] = 0;
699   $set['type'] = CONF_TYPE_TEXT;
700   $set['level'] = 4;
701   $set['readonly'] = 1;
702   $freepbx_conf->define_conf_setting('AMPASTERISKWEBUSER',$set);
703   $set['level'] = 0;
704
705   // AMPASTERISKWEBGROUP
706   $set['value'] = 'asterisk';
707   $set['options'] = '';
708   $set['name'] = 'System Web Group';
709   $set['description'] = 'The user group your httpd should be running as, used by freepbx_engine. Most systems should not change this.';
710   $set['emptyok'] = 0;
711   $set['type'] = CONF_TYPE_TEXT;
712   $set['level'] = 4;
713   $set['readonly'] = 1;
714   $freepbx_conf->define_conf_setting('AMPASTERISKWEBGROUP',$set);
715   $set['level'] = 0;
716
717   // AMPDEVUSER
718   $set['value'] = 'asterisk';
719   $set['options'] = '';
720   $set['name'] = 'System Device User';
721   $set['description'] = 'The user that various device directories should be set to, used by freepbx_engine. Examples include /dev/zap, /dev/dahdi, /dev/misdn, /dev/mISDN and /dev/dsp. Most systems should not change this.';
722   $set['emptyok'] = 0;
723   $set['type'] = CONF_TYPE_TEXT;
724   $set['level'] = 4;
725   $set['readonly'] = 1;
726   $freepbx_conf->define_conf_setting('AMPDEVUSER',$set);
727   $set['level'] = 0;
728
729   // AMPDEVGROUP
730   $set['value'] = 'asterisk';
731   $set['options'] = '';
732   $set['name'] = 'System Device Group';
733   $set['description'] = 'The user group that various device directories should be set to, used by freepbx_engine. Examples include /dev/zap, /dev/dahdi, /dev/misdn, /dev/mISDN and /dev/dsp. Most systems should not change this.';
734   $set['emptyok'] = 0;
735   $set['readonly'] = 1;
736   $set['type'] = CONF_TYPE_TEXT;
737   $set['level'] = 4;
738   $freepbx_conf->define_conf_setting('AMPDEVGROUP',$set);
739   $set['level'] = 0;
740
741   // BROWSER_STATS
742   $set['value'] = true;
743   $set['options'] = '';
744   $set['name'] = 'Browser Stats';
745   $set['description'] = 'Setting this to true will allow the development team to use google analytics to anonymously analyze browser information to help make better development decision.';
746   $set['emptyok'] = 0;
747   $set['readonly'] = 0;
748   $set['type'] = CONF_TYPE_BOOL;
749   $freepbx_conf->define_conf_setting('BROWSER_STATS',$set);
750
751   // USE_GOOGLE_CDN_JS
752   $set['value'] = false;
753   $set['options'] = '';
754   $set['name'] = 'Use Google Distribution Network for js Downloads';
755   $set['description'] = 'Setting this to true will fetch system javascript libraries such as jQuery and jQuery-ui from ajax.googleapis.com. This can be advantageous if accessing remote or multiple different FreePBX systems since the libraries are only cached once in your browser. If external internet connections are problematic, setting this true could result in slow systems. FreePBX will always fallback to the locally available libraries if the CDN is not available.';
756   $set['emptyok'] = 0;
757   $set['readonly'] = 0;
758   $set['type'] = CONF_TYPE_BOOL;
759   $freepbx_conf->define_conf_setting('USE_GOOGLE_CDN_JS',$set);
760
761
762   //
763   // CATEGORY: Dialplan and Operational
764   //
765   $set['category'] = 'Dialplan and Operational';
766
767   // AMPBADNUMBER
768   $set['value'] = true;
769   $set['options'] = '';
770   $set['name'] = 'Use bad-number Context';
771   $set['description'] = 'Generate the bad-number context which traps any bogus number or feature code and plays a message to the effect. If you use the Early Dial feature on some Grandstream phones, you will want to set this to false.';
772   $set['emptyok'] = 0;
773   $set['readonly'] = 0;
774   $set['type'] = CONF_TYPE_BOOL;
775   $set['level'] = 2;
776   $freepbx_conf->define_conf_setting('AMPBADNUMBER',$set);
777   $set['level'] = 0;
778
779   // CWINUSEBUSY
780   $set['value'] = true;
781   $set['options'] = '';
782   $set['name'] = 'Occupied Lines CW Busy';
783   $set['description'] = 'For extensions that have CW enabled, report unanswered CW calls as <b>busy</b> (resulting in busy voicemail greeting). If set to no, unanswered CW calls simply report as <b>no-answer</b>.';
784   $set['emptyok'] = 0;
785   $set['readonly'] = 0;
786   $set['type'] = CONF_TYPE_BOOL;
787   $freepbx_conf->define_conf_setting('CWINUSEBUSY',$set);
788
789   // ZAP2DAHDICOMPAT
790   $set['value'] = false;
791   $set['options'] = '';
792   $set['name'] = 'Convert ZAP Settings to DAHDi';
793   $set['description'] = 'If set to true, FreePBX will check if you have chan_dahdi installed. If so, it will automatically use all your ZAP configuration settings (devices and trunks) and silently convert them, under the covers, to DAHDi so no changes are needed. The GUI will continue to refer to these as ZAP but it will use the proper DAHDi channels. This will also keep Zap Channel DIDs working.';
794   $set['emptyok'] = 0;
795   $set['readonly'] = 1;
796   $set['type'] = CONF_TYPE_BOOL;
797   $freepbx_conf->define_conf_setting('ZAP2DAHDICOMPAT',$set);
798
799   // DYNAMICHINTS
800   $set['value'] = false;
801   $set['options'] = '';
802   $set['name'] = 'Dynamically Generate Hints';
803   $set['description'] = 'If true, Core will not statically generate hints, but instead make a call to the AMPBIN php script, and generate_hints.php through an Asterisk #exec call. This requires asterisk.conf to be configured with <b>execincludes=yes<b> set in the [options] section.';
804   $set['emptyok'] = 0;
805   $set['readonly'] = 1;
806   $set['type'] = CONF_TYPE_BOOL;
807   $freepbx_conf->define_conf_setting('DYNAMICHINTS',$set);
808
809   // ENABLECW
810   $set['value'] = true;
811   $set['options'] = '';
812   $set['name'] = 'CW Enabled by Default';
813   $set['description'] = 'Enable call waiting by default when an extension is created (Default is yes). Set to <b>no</b> to if you do not want phones to be commissioned with call waiting already enabled. The user would then be required to dial the CW feature code (*70 default) to enable their phone. Most installations should leave this alone. It allows multi-line phones to receive multiple calls on their line appearances.';
814   $set['emptyok'] = 0;
815   $set['readonly'] = 0;
816   $set['type'] = CONF_TYPE_BOOL;
817   $freepbx_conf->define_conf_setting('ENABLECW',$set);
818
819   // FCBEEPONLY
820   $set['value'] = false;
821   $set['options'] = '';
822   $set['name'] = 'Feature Codes Beep Only';
823   $set['description'] = 'When set to true, a beep is played instead of confirmation message when activating/de-activating: CallForward, CallWaiting, DayNight, DoNotDisturb and FindMeFollow.';
824   $set['emptyok'] = 0;
825   $set['readonly'] = 0;
826   $set['type'] = CONF_TYPE_BOOL;
827   $freepbx_conf->define_conf_setting('FCBEEPONLY',$set);
828
829   // USEDEVSTATE
830   $set['value'] = true;
831   $set['options'] = '';
832   $set['name'] = 'Enable Custom Device States';
833   $set['description'] = 'If this is set, it assumes that you are running Asterisk 1.4 or higher and want to take advantage of the func_devstate.c backport available from Asterisk 1.6. This allows custom hints to be created to support BLF for server side feature codes such as daynight, followme, etc';
834   $set['emptyok'] = 0;
835   $set['readonly'] = 0;
836   $set['type'] = CONF_TYPE_BOOL;
837   $freepbx_conf->define_conf_setting('USEDEVSTATE',$set);
838
839   // USEGOOGLEDNSFORENUM
840   $set['value'] = false;
841   $set['options'] = '';
842   $set['name'] = 'Use Google DNS for Enum';
843   $set['description'] = 'Setting this flag will generate the required global variable so that enumlookup.agi will use Google DNS 8.8.8.8 when performing an ENUM lookup. Not all DNS deals with NAPTR record, but Google does. There is a drawback to this as Google tracks every lookup. If you are not comfortable with this, do not enable this setting. Please read Google FAQ about this: <b>http://code.google.com/speed/public-dns/faq.html#privacy</b>.';
844   $set['emptyok'] = 0;
845   $set['type'] = CONF_TYPE_BOOL;
846   $set['level'] = 2;
847   $set['readonly'] = 0;
848   $freepbx_conf->define_conf_setting('USEGOOGLEDNSFORENUM',$set);
849   $set['level'] = 0;
850
851   // DISABLECUSTOMCONTEXTS
852   $set['value'] = false;
853   $set['options'] = '';
854   $set['name'] = 'Disable -custom Context Includes';
855   $set['description'] = 'Normally FreePBX auto-generates a custom context that may be usable for adding custom dialplan to modify the normal behavior of FreePBX. It takes a good understanding of how Asterisk processes these includes to use this and in many of the cases, there is no useful application. All includes will result in a WARNING in the Asterisk log if there is no context found to include though it results in no errors. If you know that you want the includes, you can set this to true. If you comment it out FreePBX will revert to legacy behavior and include the contexts.';
856   $set['emptyok'] = 0;
857   $set['readonly'] = 0;
858   $set['type'] = CONF_TYPE_BOOL;
859   $set['level'] = 2;
860   $freepbx_conf->define_conf_setting('DISABLECUSTOMCONTEXTS',$set);
861   $set['level'] = 0;
862
863
864   // NOOPTRACE
865   $set['value'] = '0';
866   $set['options'] = '0,1,2,3,4,5,6,7,8,9,10';
867   $set['name'] = 'NoOp Traces in Dialplan';
868   $set['description'] = 'Some modules will generate lots of NoOp() commands proceeded by a [TRACE](trace_level) that can be used during development or while trying to trace call flows. These NoOp() commands serve no other purpose so if you do not want to see excessive NoOp()s in your dialplan you can set this to 0. The higher the number the more detailed level of trace NoOp()s will be generated';
869   $set['emptyok'] = 0;
870   $set['readonly'] = 0;
871   $set['type'] = CONF_TYPE_SELECT;
872   $freepbx_conf->define_conf_setting('NOOPTRACE',$set);
873
874   // DIVERSIONHEADER
875   $set['value'] = false;
876   $set['options'] = '';
877   $set['name'] = 'Generate Diversion Headers';
878   $set['description'] = 'If this value is set to true, then calls going out your outbound routes that originate from outside your PBX and were subsequently forwarded through a call forward, ring group, follow-me or other means, will have a SIP diversion header added to the call with the original incoming DID assuming there is a DID available. This is useful with some carriers that may require this under certain circumstances.';
879   $set['emptyok'] = 0;
880   $set['readonly'] = 0;
881   $set['type'] = CONF_TYPE_BOOL;
882   $freepbx_conf->define_conf_setting('DIVERSIONHEADER',$set);
883
884   // CFRINGTIMERDEFAULT
885   $opts = array();
886   for ($i=-1;$i<=120;$i++) {
887       $opts[]=$i;
888   }
889   $set['value'] = '0';
890   $set['options'] = $opts;
891   $set['name'] = 'Call Forward Ringtimer Default';
892   $set['description'] = 'This is the default time in seconds to try and connect a call that has been call forwarded by the server side CF, CFU and CFB options. (If your phones use client side CF such as SIP redirects, this will not have any affect) If set to the default of 0, it will use the standard ring timer. If set to -1 it will ring the forwarded number with no limit which is consistent with the behavior of some existing PBX systems. If set to any other value, it will ring for that duration before diverting the call to the users voicemail if they have one. This can be overridden for each extension.';
893   $set['emptyok'] = 0;
894   $set['readonly'] = 0;
895   $set['type'] = CONF_TYPE_SELECT;
896   $freepbx_conf->define_conf_setting('CFRINGTIMERDEFAULT',$set);
897   unset($opts); 
898  
899   // DEFAULT_INTERNAL_AUTO_ANSWER
900   $set['value'] = 'disabled';
901   $set['options'] = array('disabled','intercom');
902   $set['name'] = 'Internal Auto Answer Default';
903   $set['description'] = "Default setting for new extensions. When set to Intercom, calls to new extensions/users from other internal users act as if they were intercom calls meaning they will be auto-answered if the endpoint supports this feature and the system is configured to operate in this mode. All the normal white list and black list settings will be honored if they are set. External calls will still ring as normal, as will certain other circumstances such as blind transfers and when a Follow Me is configured and enabled. If Disabled, the phone rings as a normal phone.";
904   $set['emptyok'] = 0;
905   $set['readonly'] = 0;
906   $set['type'] = CONF_TYPE_SELECT;
907   $freepbx_conf->define_conf_setting('DEFAULT_INTERNAL_AUTO_ANSWER',$set);
908
909   // FORCE_INTERNAL_AUTO_ANSWER_ALL
910   $set['value'] = false;
911   $set['options'] = '';
912   $set['name'] = 'Force All Internal Auto Answer';
913   $set['description'] = "Force all extensions to operate in the Internal Auto Answer mode regardless of their individual settings. See 'Internal Auto Answer Default' for more information.";
914   $set['emptyok'] = 0;
915   $set['readonly'] = 0;
916   $set['type'] = CONF_TYPE_BOOL;
917   $freepbx_conf->define_conf_setting('FORCE_INTERNAL_AUTO_ANSWER_ALL',$set);
918
919   // CONCURRENCYLIMITDEFAULT
920   $opts = array();
921   for ($i=0;$i<=120;$i++) {
922       $opts[]=$i;
923   }
924   $set['value'] = '0';
925   $set['options'] = $opts;
926   $set['name'] = 'Extension Concurrency Limit';
927   $set['description'] = 'Default maximum number of outbound simultaneous calls that an extension can make. This is also very useful as a Security Protection against a system that has been compromised. It will limit the number of simultaneous calls that can be made on the compromised extension. This default is used when an extension is created. A default of 0 means no limit.';
928   $set['emptyok'] = 0;
929   $set['readonly'] = 0;
930   $set['type'] = CONF_TYPE_SELECT;
931   $freepbx_conf->define_conf_setting('CONCURRENCYLIMITDEFAULT',$set);
932   unset($opts); 
933
934   // BLOCK_OUTBOUND_TRUNK_CNAM
935   $set['value'] = false;
936   $set['options'] = '';
937   $set['name'] = 'Block CNAM on External Trunks';
938   $set['description'] = "Some carriers will reject a call if a CallerID Name (CNAM) is presented. This occurs in several areas when configuring CID on the PBX using the format of 'CNAM' <CNUM>. To remove the CNAM part of CID on all external trunks, set this value to true. This WILL NOT remove CNAM when a trunk is called from an Intra-Company route. This can be done on each individual trunk in addition to globally if there are trunks where it is desirable to keep CNAM information, though most carriers ignore CNAM.";
939   $set['emptyok'] = 0;
940   $set['readonly'] = 0;
941   $set['type'] = CONF_TYPE_BOOL;
942   $freepbx_conf->define_conf_setting('BLOCK_OUTBOUND_TRUNK_CNAM',$set);
943
944   // ASTSTOPTIMEOUT
945   $opts = array();
946   $set['value'] = '120';
947   $set['options'] = array(0,5,10,30,60,120,300,600,1800,3600,7200,10800);
948   $set['name'] = 'Waiting Period to Stop Asterisk';
949   $set['description'] = "When Asterisk is stopped or restarted with the 'amportal stop/restart' commands, it does a graceful stop waiting for active channels to hangup. This sets the maximum time in seconds to wait prior to force stopping Asterisk";
950   $set['emptyok'] = 0;
951   $set['readonly'] = 0;
952   $set['type'] = CONF_TYPE_SELECT;
953   $freepbx_conf->define_conf_setting('ASTSTOPTIMEOUT',$set);
954
955   // ASTSTOPPOLLINT
956   $opts = array();
957   $set['value'] = '2';
958   $set['options'] = array(1,2,3,5,10);
959   $set['name'] = 'Polling Interval for Stopping Asterisk';
960   $set['description'] = "When Asterisk is stopped or restarted with the 'amportal stop/restart' commands, it does a graceful stop waiting for active channels to hangup. This sets the polling interval to check if Asterisk is shutdown and update the countdown timer.";
961   $set['emptyok'] = 0;
962   $set['readonly'] = 0;
963   $set['type'] = CONF_TYPE_SELECT;
964   $freepbx_conf->define_conf_setting('ASTSTOPPOLLINT',$set);
965
966   // CID_PREPEND_REPLACE
967   $set['value'] = true;
968   $set['options'] = '';
969   $set['name'] = 'Only Use Last CID Prepend';
970   $set['description'] = "Some modules allow the CNAM to be prepended. If a previous prepend was done, the default behavior is to remove the previous prepend and only use the most recent one. Setting this to false will turn that off allowing all prepends to be 'starcked' in front of one another.";
971   $set['emptyok'] = 0;
972   $set['readonly'] = 0;
973   $set['type'] = CONF_TYPE_BOOL;
974   $freepbx_conf->define_conf_setting('CID_PREPEND_REPLACE',$set);
975
976   // DITECH_VQA_INBOUND
977   $set['value'] = '7';
978   $set['options'] = array(0,1,2,3,4,5,6,7);
979   $set['name'] = 'Ditech VQA Inbound Setting';
980   $set['description'] = "If Ditech's VQA, Voice Quality application is installed, this setting will be used for all inbound calls. For more information 'core show application VQA' at the Asterisk CLI will show the different settings.";
981   $set['emptyok'] = 0;
982   $set['readonly'] = 0;
983   $set['type'] = CONF_TYPE_SELECT;
984   $freepbx_conf->define_conf_setting('DITECH_VQA_INBOUND',$set);
985
986   // DITECH_VQA_OUTBOUND
987   $set['value'] = '7';
988   $set['options'] = array(0,1,2,3,4,5,6,7);
989   $set['name'] = 'Ditech VQA Outbound Setting';
990   $set['description'] = "If Ditech's VQA, Voice Quality application is installed, this setting will be used for all outbound calls. For more information 'core show application VQA' at the Asterisk CLI will show the different settings.";
991   $set['emptyok'] = 0;
992   $set['readonly'] = 0;
993   $set['type'] = CONF_TYPE_SELECT;
994   $freepbx_conf->define_conf_setting('DITECH_VQA_OUTBOUND',$set);
995
996
997   //
998   // CATEGORY: Directory Layout
999   //
1000   $set['category'] = 'Directory Layout';
1001
1002   // AMPBIN
1003   $set['value'] = '/var/lib/asterisk/bin';
1004   $set['options'] = '';
1005   $set['name'] = 'FreePBX bin Dir';
1006   $set['description'] = 'Location of the FreePBX command line scripts.';
1007   $set['emptyok'] = 0;
1008   $set['readonly'] = 1;
1009   $set['type'] = CONF_TYPE_DIR;
1010   $set['level'] = 4;
1011   $freepbx_conf->define_conf_setting('AMPBIN',$set);
1012
1013   // AMPSBIN
1014   $set['value'] = '/usr/sbin';
1015   $set['options'] = '';
1016   $set['name'] = 'FreePBX sbin Dir';
1017   $set['description'] = 'Where (root) command line scripts are located.';
1018   $set['emptyok'] = 0;
1019   $set['readonly'] = 1;
1020   $set['type'] = CONF_TYPE_DIR;
1021   $set['level'] = 4;
1022   $freepbx_conf->define_conf_setting('AMPSBIN',$set);
1023    
1024   // AMPWEBROOT
1025   $set['value'] = '/var/www/html';
1026   $set['options'] = '';
1027   $set['name'] = 'FreePBX Web Root Dir';
1028   $set['description'] = 'The path to Apache webroot (leave off trailing slash).';
1029   $set['emptyok'] = 0;
1030   $set['readonly'] = 1;
1031   $set['type'] = CONF_TYPE_DIR;
1032   $set['level'] = 4;
1033   $freepbx_conf->define_conf_setting('AMPWEBROOT',$set);
1034
1035   // ASTAGIDIR
1036   $set['value'] = '/var/lib/asterisk/agi-bin';
1037   $set['options'] = '';
1038   $set['name'] = 'Asterisk AGI Dir';
1039   $set['description'] = 'This is the default directory for Asterisks agi files.';
1040   $set['emptyok'] = 0;
1041   $set['readonly'] = 1;
1042   $set['type'] = CONF_TYPE_DIR;
1043   $set['level'] = 4;
1044   $freepbx_conf->define_conf_setting('ASTAGIDIR',$set);
1045
1046   // ASTETCDIR
1047   $set['value'] = '/etc/asterisk';
1048   $set['options'] = '';
1049   $set['name'] = 'Asterisk etc Dir';
1050   $set['description'] = 'This is the default directory for Asterisks configuration files.';
1051   $set['emptyok'] = 0;
1052   $set['readonly'] = 1;
1053   $set['type'] = CONF_TYPE_DIR;
1054   $set['level'] = 4;
1055   $freepbx_conf->define_conf_setting('ASTETCDIR',$set);
1056
1057   // ASTLOGDIR
1058   $set['value'] = '/var/log/asterisk';
1059   $set['options'] = '';
1060   $set['name'] = 'Asterisk Log Dir';
1061   $set['description'] = 'This is the default directory for Asterisks log files.';
1062   $set['emptyok'] = 0;
1063   $set['readonly'] = 1;
1064   $set['type'] = CONF_TYPE_DIR;
1065   $set['level'] = 4;
1066   $freepbx_conf->define_conf_setting('ASTLOGDIR',$set);
1067
1068   // ASTMODDIR
1069   $set['value'] = '/usr/lib/asterisk/modules';
1070   $set['options'] = '';
1071   $set['name'] = 'Asterisk Modules Dir';
1072   $set['description'] = 'This is the default directory for Asterisks modules.';
1073   $set['emptyok'] = 0;
1074   $set['readonly'] = 1;
1075   $set['type'] = CONF_TYPE_DIR;
1076   $set['level'] = 4;
1077   $freepbx_conf->define_conf_setting('ASTMODDIR',$set);
1078
1079   // ASTSPOOLDIR
1080   $set['value'] = '/var/spool/asterisk';
1081   $set['options'] = '';
1082   $set['name'] = 'Asterisk Spool Dir';
1083   $set['description'] = 'This is the default directory for Asterisks spool directory.';
1084   $set['emptyok'] = 0;
1085   $set['readonly'] = 1;
1086   $set['type'] = CONF_TYPE_DIR;
1087   $set['level'] = 4;
1088   $freepbx_conf->define_conf_setting('ASTSPOOLDIR',$set);
1089
1090   // ASTRUNDIR
1091   $set['value'] = '/var/run/asterisk';
1092   $set['options'] = '';
1093   $set['name'] = 'Asterisk Run Dir';
1094   $set['description'] = 'This is the default directory for Asterisks run files.';
1095   $set['emptyok'] = 0;
1096   $set['readonly'] = 1;
1097   $set['type'] = CONF_TYPE_DIR;
1098   $set['level'] = 4;
1099   $freepbx_conf->define_conf_setting('ASTRUNDIR',$set);
1100
1101   // ASTVARLIBDIR
1102   $set['value'] = '/var/lib/asterisk';
1103   $set['options'] = '';
1104   $set['name'] = 'Asterisk bin Dir';
1105   $set['description'] = 'This is the default directory for Asterisks lib files.';
1106   $set['emptyok'] = 0;
1107   $set['readonly'] = 1;
1108   $set['type'] = CONF_TYPE_DIR;
1109   $set['level'] = 4;
1110   $freepbx_conf->define_conf_setting('ASTVARLIBDIR',$set);
1111
1112   // AMPCGIBIN
1113   $set['value'] = '/var/www/cgi-bin ';
1114   $set['options'] = '';
1115   $set['name'] = 'CGI Dir';
1116   $set['description'] = 'The path to Apache cgi-bin dir (leave off trailing slash).';
1117   $set['emptyok'] = 0;
1118   $set['readonly'] = 1;
1119   $set['type'] = CONF_TYPE_DIR;
1120   $set['level'] = 4;
1121   $freepbx_conf->define_conf_setting('AMPCGIBIN',$set);
1122
1123   // MOHDIR
1124   $set['value'] = 'moh';
1125   $set['options'] = array('moh','mohmp3');
1126   $set['name'] = 'MoH Subdirectory';
1127   $set['description'] = 'This is the subdirectory for the MoH files/directories which is located in ASTVARLIBDIR. Older installation may be using mohmp3 which was the old Asterisk default and should be set to that value if the music files are located there relative to the ASTVARLIBDIR.';
1128   $set['emptyok'] = 0;
1129   $set['readonly'] = 1;
1130   $set['type'] = CONF_TYPE_SELECT;
1131   $set['level'] = 4;
1132   $freepbx_conf->define_conf_setting('MOHDIR',$set);
1133   $set['level'] = 0;
1134
1135
1136   //
1137   // CATEGORY: GUI Behavior
1138   //
1139   $set['category'] = 'GUI Behavior';
1140
1141   // CHECKREFERER
1142   $set['value'] = true;
1143   $set['options'] = '';
1144   $set['name'] = 'Check Server Referrer';
1145   $set['description'] = 'When set to the default value of true, all requests into FreePBX that might possibly add/edit/delete settings will be validated to assure the request is coming from the server. This will protect the system from CSRF (cross site request forgery) attacks. It will have the effect of preventing legitimately entering URLs that could modify settings which can be allowed by changing this field to false.';
1146   $set['emptyok'] = 0;
1147   $set['readonly'] = 0;
1148   $set['type'] = CONF_TYPE_BOOL;
1149   $freepbx_conf->define_conf_setting('CHECKREFERER',$set);
1150
1151   // MODULEADMINWGET
1152   $set['value'] = false;
1153   $set['options'] = '';
1154   $set['name'] = 'Use wget For Module Admin';
1155   $set['description'] = 'Module Admin normally tries to get its online information through direct file open type calls to URLs that go back to the freepbx.org server. If it fails, typically because of content filters in firewalls that do not like the way PHP formats the requests, the code will fall back and try a wget to pull the information. This will often solve the problem. However, in such environment there can be a significant timeout before the failed file open calls to the URLs return and there are often 2-3 of these that occur. Setting this value will force FreePBX to avoid the attempt to open the URL and go straight to the wget calls.';
1156   $set['emptyok'] = 0;
1157   $set['readonly'] = 0;
1158   $set['type'] = CONF_TYPE_BOOL;
1159   $freepbx_conf->define_conf_setting('MODULEADMINWGET',$set);
1160
1161   // USECATEGORIES
1162   $set['value'] = true;
1163   $set['options'] = '';
1164   $set['name'] = 'Show Categories in Nav Menu';
1165   $set['description'] = 'Controls if the menu items in the admin interface are sorted by category (true) or sorted alphabetically with no categories shown (false). Defaults = true';
1166   $set['emptyok'] = 0;
1167   $set['readonly'] = 0;
1168   $set['type'] = CONF_TYPE_BOOL;
1169   $freepbx_conf->define_conf_setting('USECATEGORIES',$set);
1170
1171   // SERVERINTITLE
1172   $set['value'] = false;
1173   $set['options'] = '';
1174   $set['name'] = 'Include Server Name in Browser';
1175   $set['description'] = 'Precede browser title with the server name.';
1176   $set['emptyok'] = 0;
1177   $set['readonly'] = 0;
1178   $set['type'] = CONF_TYPE_BOOL;
1179   $freepbx_conf->define_conf_setting('SERVERINTITLE',$set);
1180
1181   // RELOADCONFIRM
1182   $set['value'] = true;
1183   $set['options'] = '';
1184   $set['name'] = 'Require Confirm with Apply Changes';
1185   $set['description'] = 'When set to false, will bypass the confirm on Reload Box.';
1186   $set['emptyok'] = 0;
1187   $set['readonly'] = 0;
1188   $set['type'] = CONF_TYPE_BOOL;
1189   $freepbx_conf->define_conf_setting('RELOADCONFIRM',$set);
1190
1191   // BADDESTABORT
1192   $set['value'] = false;
1193   $set['options'] = '';
1194   $set['name'] = 'Abort Config Gen on Bad Dest';
1195   $set['description'] = 'Setting either of these to true will result in retrieve_conf aborting during a reload if an extension conflict is detected or a destination is detected. It is usually better to allow the reload to go through and then correct the problem but these can be set if a more strict behavior is desired.';
1196   $set['emptyok'] = 0;
1197   $set['level'] = 3;
1198   $set['readonly'] = 0;
1199   $set['type'] = CONF_TYPE_BOOL;
1200   $freepbx_conf->define_conf_setting('BADDESTABORT',$set);
1201   $set['level'] = 0;
1202
1203   // XTNCONFLICTABORT
1204   $set['value'] = false;
1205   $set['options'] = '';
1206   $set['name'] = 'Abort Config Gen on Exten Conflict';
1207   $set['description'] = 'Setting either of these to true will result in retrieve_conf aborting during a reload if an extension conflict is detected or a destination is detected. It is usually better to allow the reload to go through and then correct the problem but these can be set if a more strict behavior is desired.';
1208   $set['emptyok'] = 0;
1209   $set['level'] = 3;
1210   $set['readonly'] = 0;
1211   $set['type'] = CONF_TYPE_BOOL;
1212   $freepbx_conf->define_conf_setting('XTNCONFLICTABORT',$set);
1213   $set['level'] = 0;
1214
1215   // CUSTOMASERROR
1216   $set['value'] = true;
1217   $set['options'] = '';
1218   $set['name'] = 'Report Unknown Dest as Error';
1219   $set['description'] = 'If false, then the Destination Registry will not report unknown destinations as errors. This should be left to the default true and custom destinations should be moved into the new custom apps registry.';
1220   $set['emptyok'] = 0;
1221   $set['level'] = 2;
1222   $set['readonly'] = 0;
1223   $set['type'] = CONF_TYPE_BOOL;
1224   $freepbx_conf->define_conf_setting('CUSTOMASERROR',$set);
1225   $set['level'] = 0;
1226
1227 // ALWAYS_SHOW_DEVICE_DETAILS
1228   $set['value'] = false;
1229   $set['options'] = '';
1230   $set['name'] = 'Show all Device Setting on Add';
1231   $set['description'] = 'When adding a new extension/device, setting this to true will show most available device settings that are displayed when you edit the same extension/device. Otherwise, just a few basic settings are displayed.';
1232   $set['emptyok'] = 0;
1233   $set['level'] = 0;
1234   $set['readonly'] = 0;
1235   $set['type'] = CONF_TYPE_BOOL;
1236   $freepbx_conf->define_conf_setting('ALWAYS_SHOW_DEVICE_DETAILS',$set);
1237   $set['level'] = 0;
1238
1239 // USE_FREEPBX_MENU_CONF
1240   $set['value'] = false;
1241   $set['options'] = '';
1242   $set['name'] = 'Use freepbx_menu.conf Configuration';
1243   $set['description'] = 'When set to true, the system will check for a freepbx_menu.conf file amongst the normal configuraiton files and if found, it will be used to define and remap the menu tabs and contents. See the template supplied with FreePBX for details on how to do this.';
1244   $set['emptyok'] = 0;
1245   $set['level'] = 0;
1246   $set['readonly'] = 0;
1247   $set['type'] = CONF_TYPE_BOOL;
1248   $freepbx_conf->define_conf_setting('USE_FREEPBX_MENU_CONF',$set);
1249   $set['level'] = 0;
1250
1251
1252   //
1253   // CATEGORY: Asterisk Manager
1254   //
1255   $set['category'] = 'Asterisk Manager';
1256
1257   // AMPMGRPASS
1258   $set['value'] = 'amp111';
1259   $set['options'] = '';
1260   $set['name'] = 'Asterisk Manager Password';
1261   $set['description'] = 'Password for accessing the Asterisk Manager Interface (AMI), this will be automatically updated in manager.conf.';
1262   $set['emptyok'] = 0;
1263   $set['type'] = CONF_TYPE_TEXT;
1264   $set['level'] = 2;
1265   $set['readonly'] = 0;
1266   $freepbx_conf->define_conf_setting('AMPMGRPASS',$set);
1267   $set['level'] = 0;
1268
1269   // AMPMGRUSER
1270   $set['value'] = 'admin';
1271   $set['options'] = '';
1272   $set['name'] = 'Asterisk Manager User';
1273   $set['description'] = 'Username for accessing the Asterisk Manager Interface (AMI), this will be automatically updated in manager.conf.';
1274   $set['emptyok'] = 0;
1275   $set['readonly'] = 0;
1276   $set['type'] = CONF_TYPE_TEXT;
1277   $set['level'] = 2;
1278   $freepbx_conf->define_conf_setting('AMPMGRUSER',$set);
1279   $set['level'] = 0;
1280
1281   // ASTMANAGERHOST
1282   $set['value'] = 'localhost';
1283   $set['options'] = '';
1284   $set['name'] = 'Asterisk Manager Host';
1285   $set['description'] = 'Hostname for the Asterisk Manager';
1286   $set['emptyok'] = 0;
1287   $set['readonly'] = 1;
1288   $set['type'] = CONF_TYPE_TEXT;
1289   $set['level'] = 2;
1290   $freepbx_conf->define_conf_setting('ASTMANAGERHOST',$set);
1291   $set['level'] = 0;
1292
1293   // ASTMANAGERPORT
1294   $set['value'] = '5038';
1295   $set['name'] = 'Asterisk Manager Port';
1296   $set['description'] = 'Port for the Asterisk Manager';
1297   $set['emptyok'] = 0;
1298   $set['readonly'] = 1;
1299   $set['type'] = CONF_TYPE_INT;
1300   $set['options'] = array(1024,65535);
1301   $set['level'] = 2;
1302   $freepbx_conf->define_conf_setting('ASTMANAGERPORT',$set);
1303   $set['level'] = 0;
1304
1305   // ASTMANAGERPROXYPORT
1306   $set['value'] = '';
1307   $set['name'] = 'Asterisk Manager Proxy Port';
1308   $set['description'] = 'Optional port for an Asterisk Manager Proxy';
1309   $set['readonly'] = 1;
1310   $set['type'] = CONF_TYPE_INT;
1311   $set['emptyok'] = 1;
1312   $set['options'] = array(1024,65535);
1313   $set['level'] = 2;
1314   $freepbx_conf->define_conf_setting('ASTMANAGERPROXYPORT',$set);
1315   $set['level'] = 0;
1316
1317   // ASTMGRWRITETIMEOUT
1318   $set['value'] = '5000';
1319   $set['name'] = 'Asterisk Manager Write Timeout';
1320   $set['description'] =
1321     'Timeout, im ms, for write timeouts for cases where Asterisk disconnects frequently';
1322   $set['readonly'] = 1;
1323   $set['type'] = CONF_TYPE_INT;
1324   $set['emptyok'] = 1;
1325   $set['options'] = array(100,100000);
1326   $set['level'] = 2;
1327   $freepbx_conf->define_conf_setting('ASTMGRWRITETIMEOUT',$set);
1328   $set['level'] = 0;
1329
1330   //
1331   // CATEGORY: Developer and Customization
1332   //
1333   $set['category'] = 'Developer and Customization';
1334   $set['level'] = 2;
1335
1336   // FPBXDBUGFILE
1337   $set['value'] = $amp_conf['ASTLOGDIR'] . '/freepbx_dbug';
1338   $set['options'] = '';
1339   $set['name'] = 'Debug File';
1340   $set['description'] = 'Full path and name of FreePBX debug file. Used by the dbug() function by developers.';
1341   $set['emptyok'] = 0;
1342   $set['readonly'] = 0;
1343   $set['type'] = CONF_TYPE_TEXT;
1344   $freepbx_conf->define_conf_setting('FPBXDBUGFILE',$set);
1345
1346   // FPBXDBUGDISABLE
1347   $set['value'] = true;
1348   $set['options'] = '';
1349   $set['name'] = 'Disable FreePBX dbug Logging';
1350   $set['description'] = 'Set to true to stop all dbug() calls from writing to the Debug File (FPBXDBUGFILE)';
1351   $set['emptyok'] = 0;
1352   $set['readonly'] = 0;
1353   $set['type'] = CONF_TYPE_BOOL;
1354   $freepbx_conf->define_conf_setting('FPBXDBUGDISABLE',$set);
1355
1356   // DIE_FREEPBX_VERBOSE
1357   $set['value'] = false;
1358   $set['options'] = '';
1359   $set['name'] = 'Provide Verbose Tracebacks';
1360   $set['description'] = 'Provides a very verbose traceback when die_freepbx() is called including extensive object details if present in the traceback.';
1361   $set['emptyok'] = 0;
1362   $set['readonly'] = 0;
1363   $set['type'] = CONF_TYPE_BOOL;
1364   $freepbx_conf->define_conf_setting('DIE_FREEPBX_VERBOSE',$set);
1365
1366
1367
1368   // DEVEL
1369   $set['value'] = false;
1370   $set['options'] = '';
1371   $set['name'] = 'Developer Mode';
1372   $set['description'] = 'This enables several debug features geared towards developers, including some page load timing information, some debug information in Module Admin, use of original CSS files and other future capabilities will be enabled.';
1373   $set['emptyok'] = 0;
1374   $set['readonly'] = 0;
1375   $set['type'] = CONF_TYPE_BOOL;
1376   $freepbx_conf->define_conf_setting('DEVEL',$set);
1377
1378   // USE_PACKAGED_JS
1379   $set['value'] = true;
1380   $set['options'] = '';
1381   $set['name'] = 'Use Packaged Javascript Library ';
1382   $set['description'] = 'FreePBX packages several javascript libraries and components into a compressed file called libfreepbx.javascript.js. By default this will be loaded instead of the individual uncompressed libraries. Setting this to false will force FreePBX to load all the libraries as individual uncompressed files. This is useful during development and debugging.';
1383   $set['emptyok'] = 0;
1384   $set['readonly'] = 0;
1385   $set['type'] = CONF_TYPE_BOOL;
1386   $freepbx_conf->define_conf_setting('USE_PACKAGED_JS',$set);
1387
1388   // FORCE_JS_CSS_IMG_DOWNLOAD
1389   $set['value'] = false;
1390   $set['options'] = '';
1391   $set['name'] = 'Always Download Web Assets';
1392   $set['description'] = 'FreePBX appends versioning tags on the CSS and javascript files and some of the main logo images. The versioning will help force browsers to load new versions of the files when module versions are upgraded. Setting this value to true will try to force these to be loaded to the browser every page load by appending an additional timestamp in the version information. This is useful during development and debugging where changes are being made to javascript and CSS files.';
1393   $set['emptyok'] = 0;
1394   $set['readonly'] = 0;
1395   $set['type'] = CONF_TYPE_BOOL;
1396   $freepbx_conf->define_conf_setting('FORCE_JS_CSS_IMG_DOWNLOAD',$set);
1397
1398   // DEVELRELOAD
1399   $set['value'] = false;
1400   $set['options'] = '';
1401   $set['name'] = 'Leave Reload Bar Up';
1402   $set['description'] = "Forces the 'Apply Configuration Changes' reload bar to always be present even when not necessary.";
1403   $set['emptyok'] = 0;
1404   $set['readonly'] = 0;
1405   $set['type'] = CONF_TYPE_BOOL;
1406   $freepbx_conf->define_conf_setting('DEVELRELOAD',$set);
1407
1408   // PRE_RELOAD
1409   $set['value'] = '';
1410   $set['options'] = '';
1411   $set['name'] = 'PRE_RELOAD Script';
1412   $set['description'] = 'Optional script to run just prior to doing an extension reload to Asterisk through the manager after pressing Apply Configuration Changes in the GUI.';
1413   $set['emptyok'] = 1;
1414   $set['readonly'] = 1;
1415   $set['type'] = CONF_TYPE_TEXT;
1416   $freepbx_conf->define_conf_setting('PRE_RELOAD',$set);
1417
1418   // POST_RELOAD
1419   $set['value'] = '';
1420   $set['options'] = '';
1421   $set['name'] = 'POST_RELOAD Script';
1422   $set['description'] = 'Automatically execute a script after applying changes in the AMP admin. Set POST_RELOAD to the script you wish to execute after applying changes. If POST_RELOAD_DEBUG=true, you will see the output of the script in the web page.';
1423   $set['emptyok'] = 1;
1424   $set['readonly'] = 1;
1425   $set['type'] = CONF_TYPE_TEXT;
1426   $freepbx_conf->define_conf_setting('POST_RELOAD',$set);
1427
1428   // POST_RELOAD_DEBUG
1429   $set['value'] = false;
1430   $set['options'] = '';
1431   $set['name'] = 'POST_RELOAD Debug Mode';
1432   $set['description'] = 'Display debug output for script used if POST_RELOAD is used.';
1433   $set['emptyok'] = 0;
1434   $set['readonly'] = 0;
1435   $set['type'] = CONF_TYPE_BOOL;
1436   $freepbx_conf->define_conf_setting('POST_RELOAD_DEBUG',$set);
1437
1438   // AMPLOCALBIN
1439   $set['value'] = '';
1440   $set['options'] = '';
1441   $set['name'] = 'AMPLOCALBIN Dir for retrieve_conf';
1442   $set['description'] = 'If this directory is defined, retrieve_conf will check for a file called <i>retrieve_conf_post_custom</i> and if that file exists, it will be included after other processing thus having full access to the current environment for additional customization.';
1443   $set['emptyok'] = 1;
1444   $set['readonly'] = 1;
1445   $set['type'] = CONF_TYPE_DIR;
1446   $freepbx_conf->define_conf_setting('AMPLOCALBIN',$set);
1447  
1448   // DISABLE_CSS_AUTOGEN
1449   $set['value'] = false;
1450   $set['options'] = '';
1451   $set['name'] = 'Disable Mainstyle CSS Compression';
1452   $set['description'] = 'Stops the automatic generation of a stripped CSS file that replaces the primary sheet, usually mainstyle.css.';
1453   $set['emptyok'] = 0;
1454   $set['readonly'] = 0;
1455   $set['type'] = CONF_TYPE_BOOL;
1456   $freepbx_conf->define_conf_setting('DISABLE_CSS_AUTOGEN',$set);
1457
1458   // MODULEADMIN_SKIP_CACHE
1459   $set['value'] = false;
1460   $set['options'] = '';
1461   $set['name'] = 'Disable Module Admin Caching';
1462   $set['description'] = 'Module Admin caches a copy of the online XML document that describes what is available on the server. Subsequent online update checks will use the cached information if it is less than 5 minutes old. To bypass the cache and force it to go to the server each time, set this to True. This should normally be false but can be helpful during testing.';
1463   $set['emptyok'] = 0;
1464   $set['readonly'] = 1;
1465   $set['type'] = CONF_TYPE_BOOL;
1466   $freepbx_conf->define_conf_setting('MODULEADMIN_SKIP_CACHE',$set);
1467
1468   //
1469   // CATEGORY: Flash Operator Panel
1470   //
1471   $set['category'] = 'Flash Operator Panel';
1472   $set['level'] = 0;
1473
1474   // FOPWEBROOT also used by FOP2 and iSymphony modules
1475   // FOPWEBROOT
1476   $set['value'] = '';
1477   $set['options'] = '';
1478   $set['name'] = 'FOP Web Root Dir';
1479   $set['description'] = 'Path to the Flash Operator Panel webroot or other modules providing such functionality (leave off trailing slash).';
1480   $set['emptyok'] = 1;
1481   $set['readonly'] = 1;
1482   $set['type'] = CONF_TYPE_DIR;
1483   $set['level'] = 4;
1484   $freepbx_conf->define_conf_setting('FOPWEBROOT',$set);
1485   $set['level'] = 0;
1486
1487
1488   //
1489   // CATEGORY: Remote CDR Database
1490   //
1491   $set['category'] = 'Remote CDR Database';
1492   $set['level'] = 3;
1493
1494   // CDRDBHOST
1495   $set['value'] = '';
1496   $set['options'] = '';
1497   $set['name'] = 'Remote CDR DB Host';
1498   $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you do not use the default values provided by FreePBX.<br>Hostname of db server if not the same as AMPDBHOST.';
1499   $set['emptyok'] = 1;
1500   $set['readonly'] = 1;
1501   $set['type'] = CONF_TYPE_TEXT;
1502   $freepbx_conf->define_conf_setting('CDRDBHOST',$set);
1503
1504   // CDRDBNAME
1505   $set['value'] = '';
1506   $set['options'] = '';
1507   $set['name'] = 'Remote CDR DB Name';
1508   $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you do not use the default values provided by FreePBX.<br>Name of database used for cdr records.';
1509   $set['emptyok'] = 1;
1510   $set['readonly'] = 1;
1511   $set['type'] = CONF_TYPE_TEXT;
1512   $freepbx_conf->define_conf_setting('CDRDBNAME',$set);
1513
1514   // CDRDBPASS
1515   $set['value'] = '';
1516   $set['options'] = '';
1517   $set['name'] = 'Remote CDR DB Password';
1518   $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you do not use the default values provided by FreePBX.<br>Password for connecting to db if its not the same as AMPDBPASS.';
1519   $set['emptyok'] = 1;
1520   $set['readonly'] = 1;
1521   $set['type'] = CONF_TYPE_TEXT;
1522   $freepbx_conf->define_conf_setting('CDRDBPASS',$set);
1523
1524   // CDRDBPORT
1525   $set['value'] = '';
1526   $set['options'] = array(1024,65536);
1527   $set['name'] = 'Remote CDR DB Port';
1528   $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you do not use the default values provided by FreePBX.<br>Port number for db host.';
1529   $set['emptyok'] = 1;
1530   $set['readonly'] = 1;
1531   $set['type'] = CONF_TYPE_INT;
1532   $freepbx_conf->define_conf_setting('CDRDBPORT',$set);
1533
1534   // CDRDBTABLENAME
1535   $set['value'] = '';
1536   $set['options'] = '';
1537   $set['name'] = 'Remote CDR DB Table';
1538   $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you do not use the default values provided by FreePBX. Name of the table in the db where the cdr is stored. cdr is default.';
1539   $set['emptyok'] = 1;
1540   $set['readonly'] = 1;
1541   $set['type'] = CONF_TYPE_TEXT;
1542   $freepbx_conf->define_conf_setting('CDRDBTABLENAME',$set);
1543
1544   // CDRDBTYPE
1545   $set['value'] = '';
1546   $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you do not use the default values provided by FreePBX. Defaults to your configured AMDBENGINE.';
1547   $set['name'] = 'Remote CDR DB Type';
1548   $set['emptyok'] = 1;
1549   $set['options'] = ',mysql,postgres';
1550   $set['readonly'] = 1;
1551   $set['type'] = CONF_TYPE_SELECT;
1552   $freepbx_conf->define_conf_setting('CDRDBTYPE',$set);
1553
1554   // CDRDBUSER
1555   $set['value'] = '';
1556   $set['options'] = '';
1557   $set['name'] = 'Remote CDR DB User';
1558   $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you do not use the default values provided by FreePBX. Username to connect to db with if it is not the same as AMPDBUSER.';
1559   $set['emptyok'] = 1;
1560   $set['readonly'] = 1;
1561   $set['type'] = CONF_TYPE_TEXT;
1562   $freepbx_conf->define_conf_setting('CDRDBUSER',$set);
1563
1564
1565   //
1566   // CATEGORY: Styling and Logos
1567   //
1568   $set['category'] = 'Styling and Logos';
1569   $set['level'] = 1;
1570
1571   // BRAND_IMAGE_TANGO_LEFT
1572   $set['value'] = 'images/tango.png';
1573   $set['options'] = '';
1574   $set['name'] = 'Image: Left Upper';
1575   $set['description'] = 'Left upper logo.  Path is relative to admin.';
1576   $set['readonly'] = 1;
1577   $set['sortorder'] = 40;
1578   $set['type'] = CONF_TYPE_TEXT;
1579   $set['emptyok'] = 0;
1580   $freepbx_conf->define_conf_setting('BRAND_IMAGE_TANGO_LEFT',$set);
1581
1582   // BRAND_IMAGE_FREEPBX_FOOT
1583   $set['value'] = 'images/freepbx_small.png';
1584   $set['options'] = '';
1585   $set['name'] = 'Image: Footer';
1586   $set['description'] = 'Logo in footer.  Path is relative to admin.';
1587   $set['readonly'] = 1;
1588   $set['sortorder'] = 50;
1589   $set['type'] = CONF_TYPE_TEXT;
1590   $set['emptyok'] = 1;
1591   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_FOOT',$set);
1592
1593   // BRAND_IMAGE_SPONSOR_FOOT
1594   $set['value'] = 'images/schmooze-logo.png';
1595   $set['options'] = '';
1596   $set['name'] = 'Image: Footer';
1597   $set['description'] = 'Logo in footer.  Path is relative to admin.';
1598   $set['readonly'] = 1;
1599   $set['sortorder'] = 50;
1600   $set['type'] = CONF_TYPE_TEXT;
1601   $set['emptyok'] = 1;
1602   $freepbx_conf->define_conf_setting('BRAND_IMAGE_SPONSOR_FOOT',$set);
1603
1604   // BRAND_FREEPBX_ALT_LEFT
1605   $set['value'] = '';
1606   $set['options'] = '';
1607   $set['name'] = 'Alt for Left Logo';
1608   $set['description'] = 'alt attribute to use in place of image and title hover value. Defaults to FreePBX';
1609   $set['readonly'] = 1;
1610   $set['sortorder'] = 70;
1611   $set['type'] = CONF_TYPE_TEXT;
1612   $set['emptyok'] = 1;
1613   $freepbx_conf->define_conf_setting('BRAND_FREEPBX_ALT_LEFT',$set);
1614
1615   // BRAND_FREEPBX_ALT_FOOT
1616   $set['value'] = 'FreePBX&reg;';
1617   $set['options'] = '';
1618   $set['name'] = 'Alt for Footer Logo';
1619   $set['description'] = 'alt attribute to use in place of image and title hover value. Defaults to FreePBX';
1620   $set['readonly'] = 1;
1621   $set['sortorder'] = 90;
1622   $set['type'] = CONF_TYPE_TEXT;
1623   $set['emptyok'] = 1;
1624   $freepbx_conf->define_conf_setting('BRAND_FREEPBX_ALT_FOOT',$set);
1625
1626   // BRAND_SPONSOR_ALT_FOOT
1627   $set['value'] = 'www.schmoozecom.com';
1628   $set['options'] = '';
1629   $set['name'] = 'Alt for Footer Logo';
1630   $set['description'] = 'alt attribute to use in place of image and title hover value. Defaults to FreePBX';
1631   $set['readonly'] = 1;
1632   $set['sortorder'] = 90;
1633   $set['type'] = CONF_TYPE_TEXT;
1634   $set['emptyok'] = 1;
1635   $freepbx_conf->define_conf_setting('BRAND_SPONSOR_ALT_FOOT',$set);
1636
1637   // BRAND_IMAGE_FREEPBX_LINK_LEFT
1638   $set['value'] = 'http://www.freepbx.org';
1639   $set['options'] = '';
1640   $set['name'] = 'Link for Left Logo';
1641   $set['description'] = 'link to follow when clicking on logo, defaults to http://www.freepbx.org';
1642   $set['readonly'] = 1;
1643   $set['sortorder'] = 100;
1644   $set['type'] = CONF_TYPE_TEXT;
1645   $set['emptyok'] = 1;
1646   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_LINK_LEFT',$set);
1647
1648   // BRAND_IMAGE_FREEPBX_LINK_FOOT
1649   $set['value'] = 'http://www.freepbx.org';
1650   $set['options'] = '';
1651   $set['name'] = 'Link for Footer Logo';
1652   $set['description'] = 'link to follow when clicking on logo, defaults to http://www.freepbx.org';
1653   $set['readonly'] = 1;
1654   $set['sortorder'] = 120;
1655   $set['type'] = CONF_TYPE_TEXT;
1656   $set['emptyok'] = 1;
1657   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_LINK_FOOT',$set);
1658
1659   // BRAND_IMAGE_SPONSOR_LINK_FOOT
1660   $set['value'] = 'http://www.schmoozecom.com';
1661   $set['options'] = '';
1662   $set['name'] = 'Link for Sponsor Footer Logo';
1663   $set['description'] = 'link to follow when clicking on sponsor logo';
1664   $set['readonly'] = 1;
1665   $set['sortorder'] = 120;
1666   $set['type'] = CONF_TYPE_TEXT;
1667   $set['emptyok'] = 1;
1668   $freepbx_conf->define_conf_setting('BRAND_IMAGE_SPONSOR_LINK_FOOT',$set);
1669
1670   // BRAND_CSS_ALT_MAINSTYLE
1671   $set['value'] = '';
1672   $set['options'] = '';
1673   $set['name'] = 'Primary CSS Stylesheet';
1674   $set['description'] = 'Set this to replace the default mainstyle.css style sheet with your own, relative to admin.';
1675   $set['readonly'] = 1;
1676   $set['sortorder'] = 160;
1677   $set['type'] = CONF_TYPE_TEXT;
1678   $set['emptyok'] = 1;
1679   $freepbx_conf->define_conf_setting('BRAND_CSS_ALT_MAINSTYLE',$set);
1680
1681   // BRAND_CSS_CUSTOM
1682   $set['value'] = '';
1683   $set['options'] = '';
1684   $set['name'] = 'Optional Additional CSS Stylesheet';
1685   $set['description'] = 'Optional custom CSS style sheet included after the primary one and any module specific ones are loaded, relative to admin.';
1686   $set['readonly'] = 1;
1687   $set['sortorder'] = 170;
1688   $set['type'] = CONF_TYPE_TEXT;
1689   $set['emptyok'] = 1;
1690   $freepbx_conf->define_conf_setting('BRAND_CSS_CUSTOM',$set);
1691
1692   // VIEW_FREEPBX_ADMIN
1693   $set['value'] = 'views/freepbx_admin.php';
1694   $set['options'] = '';
1695   $set['name'] = 'View: freepbx_admin.php';
1696   $set['description'] = 'freepbx_admin.php view. This should never be changed except for very advanced layout changes.';
1697   $set['readonly'] = 1;
1698   $set['emptyok'] = 0;
1699   $set['hidden'] = 1;
1700   $set['sortorder'] = 180;
1701   $set['type'] = CONF_TYPE_TEXT;
1702   $freepbx_conf->define_conf_setting('VIEW_FREEPBX_ADMIN',$set);
1703   $set['hidden'] = 0;
1704
1705   // VIEW_FREEPBX
1706   $set['value'] = 'views/freepbx.php';
1707   $set['options'] = '';
1708   $set['name'] = 'View: freepbx.php';
1709   $set['description'] = 'freepbx.php view. This should never be changed except for very advanced layout changes.';
1710   $set['readonly'] = 1;
1711   $set['emptyok'] = 0;
1712   $set['hidden'] = 1;
1713   $set['sortorder'] = 190;
1714   $set['type'] = CONF_TYPE_TEXT;
1715   $freepbx_conf->define_conf_setting('VIEW_FREEPBX',$set);
1716   $set['hidden'] = 0;
1717
1718   // VIEW_FREEPBX_RELOAD
1719   $set['value'] = 'views/freepbx_reload.php';
1720   $set['options'] = '';
1721   $set['name'] = 'View: freepbx_reload.php';
1722   $set['description'] = 'freepbx_reload.php view. This should never be changed except for very advanced layout changes.';
1723   $set['readonly'] = 1;
1724   $set['emptyok'] = 0;
1725   $set['hidden'] = 1;
1726   $set['sortorder'] = 200;
1727   $set['type'] = CONF_TYPE_TEXT;
1728   $freepbx_conf->define_conf_setting('VIEW_FREEPBX_RELOAD',$set);
1729   $set['hidden'] = 0;
1730
1731   // VIEW_FREEPBX_RELOADBAR
1732   $set['value'] = 'views/freepbx_reloadbar.php';
1733   $set['options'] = '';
1734   $set['name'] = 'View: freepbx_reloadbar.php';
1735   $set['description'] = 'freepbx_reloadbar.php view. This should never be changed except for very advanced layout changes.';
1736   $set['readonly'] = 1;
1737   $set['emptyok'] = 0;
1738   $set['hidden'] = 1;
1739   $set['sortorder'] = 210;
1740   $set['type'] = CONF_TYPE_TEXT;
1741   $freepbx_conf->define_conf_setting('VIEW_FREEPBX_RELOADBAR',$set);
1742   $set['hidden'] = 0;
1743
1744   // VIEW_WELCOME
1745   $set['value'] = 'views/welcome.php';
1746   $set['options'] = '';
1747   $set['name'] = 'View: welcome.php';
1748   $set['description'] = 'welcome.php view. This should never be changed except for very advanced layout changes.';
1749   $set['readonly'] = 1;
1750   $set['emptyok'] = 0;
1751   $set['hidden'] = 1;
1752   $set['sortorder'] = 220;
1753   $set['type'] = CONF_TYPE_TEXT;
1754   $freepbx_conf->define_conf_setting('VIEW_WELCOME',$set);
1755   $set['hidden'] = 0;
1756
1757   // VIEW_WELCOME_NONMANAGER
1758   $set['value'] = 'views/welcome_nomanager.php';
1759   $set['options'] = '';
1760   $set['name'] = 'View: welcome_nomanager.php';
1761   $set['description'] = 'welcome_nomanager.php view. This should never be changed except for very advanced layout changes.';
1762   $set['readonly'] = 1;
1763   $set['emptyok'] = 0;
1764   $set['hidden'] = 1;
1765   $set['sortorder'] = 230;
1766   $set['type'] = CONF_TYPE_TEXT;
1767   $freepbx_conf->define_conf_setting('VIEW_WELCOME_NONMANAGER',$set);
1768   $set['hidden'] = 0;
1769
1770   // VIEW_MENUITEM_DISABLED
1771   $set['value'] = 'views/menuitem_disabled.php';
1772   $set['options'] = '';
1773   $set['name'] = 'View: menuitem_disabled.php';
1774   $set['description'] = 'menuitem_disabled.php view. This should never be changed except for very advanced layout changes.';
1775   $set['readonly'] = 1;
1776   $set['emptyok'] = 0;
1777   $set['hidden'] = 1;
1778   $set['sortorder'] = 240;
1779   $set['type'] = CONF_TYPE_TEXT;
1780   $freepbx_conf->define_conf_setting('VIEW_MENUITEM_DISABLED',$set);
1781   $set['hidden'] = 0;
1782
1783   // VIEW_NOACCESS
1784   $set['value'] = 'views/noaccess.php';
1785   $set['options'] = '';
1786   $set['name'] = 'View: noaccess.php';
1787   $set['description'] = 'noaccess.php view. This should never be changed except for very advanced layout changes.';
1788   $set['readonly'] = 1;
1789   $set['emptyok'] = 0;
1790   $set['hidden'] = 1;
1791   $set['sortorder'] = 250;
1792   $set['type'] = CONF_TYPE_TEXT;
1793   $freepbx_conf->define_conf_setting('VIEW_NOACCESS',$set);
1794   $set['hidden'] = 0;
1795
1796   // VIEW_UNAUTHORIZED
1797   $set['value'] = 'views/unauthorized.php';
1798   $set['options'] = '';
1799   $set['name'] = 'View: unauthorized.php';
1800   $set['description'] = 'unauthorized.php view. This should never be changed except for very advanced layout changes.';
1801   $set['readonly'] = 1;
1802   $set['emptyok'] = 0;
1803   $set['hidden'] = 1;
1804   $set['sortorder'] = 260;
1805   $set['type'] = CONF_TYPE_TEXT;
1806   $freepbx_conf->define_conf_setting('VIEW_UNAUTHORIZED',$set);
1807   $set['hidden'] = 0;
1808
1809   // VIEW_BAD_REFFERER
1810   $set['value'] = 'views/bad_refferer.php';
1811   $set['options'] = '';
1812   $set['name'] = 'View: bad_refferer.php';
1813   $set['description'] = 'bad_refferer.php view. This should never be changed except for very advanced layout changes.';
1814   $set['readonly'] = 1;
1815   $set['emptyok'] = 0;
1816   $set['hidden'] = 1;
1817   $set['sortorder'] = 270;
1818   $set['type'] = CONF_TYPE_TEXT;
1819   $freepbx_conf->define_conf_setting('VIEW_BAD_REFFERER',$set);
1820   $set['hidden'] = 0;
1821
1822   // VIEW_LOGGEDOUT
1823   $set['value'] = 'views/loggedout.php';
1824   $set['options'] = '';
1825   $set['name'] = 'View: loggedout.php';
1826   $set['description'] = 'loggedout.php view. This should never be changed except for very advanced layout changes.';
1827   $set['readonly'] = 1;
1828   $set['emptyok'] = 0;
1829   $set['hidden'] = 1;
1830   $set['sortorder'] = 280;
1831   $set['type'] = CONF_TYPE_TEXT;
1832   $freepbx_conf->define_conf_setting('VIEW_LOGGEDOUT',$set);
1833   $set['hidden'] = 0;
1834
1835   // VIEW_PANEL
1836   $set['value'] = 'views/panel.php';
1837   $set['options'] = '';
1838   $set['name'] = 'View: panel.php';
1839   $set['description'] = 'panel.php view. This should never be changed except for very advanced layout changes.';
1840   $set['readonly'] = 1;
1841   $set['emptyok'] = 0;
1842   $set['hidden'] = 1;
1843   $set['sortorder'] = 290;
1844   $set['type'] = CONF_TYPE_TEXT;
1845   $freepbx_conf->define_conf_setting('VIEW_PANEL',$set);
1846   $set['hidden'] = 0;
1847
1848   // VIEW_REPORTS
1849   $set['value'] = 'views/reports.php';
1850   $set['options'] = '';
1851   $set['name'] = 'View: reports.php';
1852   $set['description'] = 'reports.php view. This should never be changed except for very advanced layout changes.';
1853   $set['readonly'] = 1;
1854   $set['emptyok'] = 0;
1855   $set['hidden'] = 1;
1856   $set['sortorder'] = 300;
1857   $set['type'] = CONF_TYPE_TEXT;
1858   $freepbx_conf->define_conf_setting('VIEW_REPORTS',$set);
1859   $set['hidden'] = 0;
1860
1861   // VIEW_MENU
1862   $set['value'] = 'views/menu.php';
1863   $set['options'] = '';
1864   $set['name'] = 'View: menu.php';
1865   $set['description'] = 'menu.php view. This should never be changed except for very advanced layout changes';
1866   $set['readonly'] = 1;
1867   $set['emptyok'] = 0;
1868   $set['hidden'] = 1;
1869   $set['sortorder'] = 310;
1870   $set['type'] = CONF_TYPE_TEXT;
1871   $freepbx_conf->define_conf_setting('VIEW_MENU', $set);
1872   $set['hidden'] = 0;
1873
1874   // JQUERY_CSS
1875   $set['value'] = 'assets/css/jquery-ui.css';
1876   $set['options'] = '';
1877   $set['name'] = 'jQuery UI css';
1878   $set['description'] = 'css file for jquery ui';
1879   $set['readonly'] = 1;
1880   $set['emptyok'] = 0;
1881   $set['hidden'] = 1;
1882   $set['sortorder'] = 320;
1883   $set['type'] = CONF_TYPE_TEXT;
1884   $freepbx_conf->define_conf_setting('JQUERY_CSS', $set);
1885   $set['hidden'] = 0;
1886
1887   // VIEW_LOGIN
1888   $set['value'] = 'views/login.php';
1889   $set['options'] = '';
1890   $set['name'] = 'View: login.php';
1891   $set['description'] = 'login.php view. This should never be changed except for very advanced layout changes';
1892   $set['readonly'] = 1;
1893   $set['emptyok'] = 0;
1894   $set['hidden'] = 1;
1895   $set['sortorder'] = 330;
1896   $set['type'] = CONF_TYPE_TEXT;
1897   $freepbx_conf->define_conf_setting('VIEW_LOGIN', $set);
1898   $set['hidden'] = 0;
1899
1900   // VIEW_HEADER
1901   $set['value'] = 'views/header.php';
1902   $set['options'] = '';
1903   $set['name'] = 'View: header.php';
1904   $set['description'] = 'header.php view. This should never be changed except for very advanced layout changes';
1905   $set['readonly'] = 1;
1906   $set['emptyok'] = 0;
1907   $set['hidden'] = 1;
1908   $set['sortorder'] = 340;
1909   $set['type'] = CONF_TYPE_TEXT;
1910   $freepbx_conf->define_conf_setting('VIEW_HEADER', $set);
1911   $set['hidden'] = 0;
1912
1913   // VIEW_FOOTER
1914   $set['value'] = 'views/footer.php';
1915   $set['options'] = '';
1916   $set['name'] = 'View: freepbx.php';
1917   $set['description'] = 'footer.php view. This should never be changed except for very advanced layout changes';
1918   $set['readonly'] = 1;
1919   $set['emptyok'] = 0;
1920   $set['hidden'] = 1;
1921   $set['sortorder'] = 350;
1922   $set['type'] = CONF_TYPE_TEXT;
1923   $freepbx_conf->define_conf_setting('VIEW_FOOTER', $set);
1924   $set['hidden'] = 0;
1925
1926   // VIEW_FOOTER_CONTENT
1927   $set['value'] = 'views/footer_content.php';
1928   $set['options'] = '';
1929   $set['name'] = 'View: footer_content.php';
1930   $set['description'] = 'footer_content.php view. This should never be changed except for very advanced layout changes';
1931   $set['readonly'] = 1;
1932   $set['emptyok'] = 0;
1933   $set['hidden'] = 1;
1934   $set['sortorder'] = 360;
1935   $set['type'] = CONF_TYPE_TEXT;
1936   $freepbx_conf->define_conf_setting('VIEW_FOOTER_CONTENT', $set);
1937   $set['hidden'] = 0;
1938
1939   // BRAND_ALT_JS
1940   $set['value'] = '';
1941   $set['options'] = '';
1942   $set['name'] = 'Alternate JS';
1943   $set['description'] = 'Alternate JS file, to supplement legacy.script.js';
1944   $set['readonly'] = 1;
1945   $set['emptyok'] = 1;
1946   $set['hidden'] = 1;
1947   $set['sortorder'] = 360;
1948   $set['type'] = CONF_TYPE_TEXT;
1949   $freepbx_conf->define_conf_setting('BRAND_ALT_JS', $set);
1950   $set['hidden'] = 0;
1951
1952
1953   //
1954   // CATEGORY: Device Setting Defaults
1955   //
1956   $set['category'] = 'Device Settings';
1957   $set['level'] = 0;
1958
1959   // ALWAYS_SHOW_DEVICE_DETAILS
1960   $set['value'] = false;
1961   $set['options'] = '';
1962   $set['name'] = 'Show all Device Setting on Add';
1963   $set['description'] = 'When adding a new extension/device, setting this to true will show most available device settings that are displayed when you edit the same extension/device. Otherwise, just a few basic settings are displayed.';
1964   $set['readonly'] = 0;
1965   $set['type'] = CONF_TYPE_BOOL;
1966   $set['emptyok'] = 0;
1967   $set['sortorder'] = 10;
1968   $freepbx_conf->define_conf_setting('ALWAYS_SHOW_DEVICE_DETAILS',$set);
1969
1970   // DEVICE_STRONG_SECRETS
1971   $set['value'] = true;
1972   $set['options'] = '';
1973   $set['name'] = 'Require Strong Secrets';
1974   $set['description'] = 'Requires a strong secret on SIP and IAX devices requiring at least two numeric and non-numeric characters and 6 or more characters. This can be disabled if using devices that can not meet these needs, or you prefer to put other constraints including more rigid constraints that this rule actually considers weak when it may not be.';
1975   $set['readonly'] = 0;
1976   $set['type'] = CONF_TYPE_BOOL;
1977   $set['emptyok'] = 0;
1978   $set['sortorder'] = 12;
1979   $freepbx_conf->define_conf_setting('DEVICE_STRONG_SECRETS',$set);
1980
1981   // DEVICE_REMOVE_MAILBOX
1982   $set['value'] = false;
1983   $set['options'] = '';
1984   $set['name'] = 'Remove mailbox Setting when no Voicemail';
1985   $set['description'] = 'If set to true, any fixed device associated with a user that has no voicemail configured will have the "mailbox=" setting removed in the generated technology configuration file such as sip_additional.conf. This will not affect the value in the GUI.';
1986   $set['readonly'] = 0;
1987   $set['type'] = CONF_TYPE_BOOL;
1988   $set['emptyok'] = 0;
1989   $set['sortorder'] = 15;
1990   $freepbx_conf->define_conf_setting('DEVICE_REMOVE_MAILBOX',$set);
1991
1992   // DEVICE_SIP_CANREINVITE
1993   $set['value'] = 'no';
1994   $set['options'] = array('no', 'yes', 'nonat', 'update');
1995   $set['name'] = 'SIP canrenivite (directmedia)';
1996   $set['description'] = 'Default setting for SIP canreinvite (same as directmedia). See Asterisk documentation for details.';
1997   $set['readonly'] = 0;
1998   $set['type'] = CONF_TYPE_SELECT;
1999   $set['emptyok'] = 0;
2000   $set['sortorder'] = 20;
2001   $freepbx_conf->define_conf_setting('DEVICE_SIP_CANREINVITE',$set);
2002
2003   // DEVICE_SIP_TRUSTRPID
2004   $set['value'] = 'yes';
2005   $set['options'] = array('no', 'yes');
2006   $set['name'] = 'SIP trustrpid';
2007   $set['description'] = 'Default setting for SIP trustrpid. See Asterisk documentation for details.';
2008   $set['readonly'] = 0;
2009   $set['type'] = CONF_TYPE_SELECT;
2010   $set['emptyok'] = 0;
2011   $set['sortorder'] = 30;
2012   $freepbx_conf->define_conf_setting('DEVICE_SIP_TRUSTRPID',$set);
2013
2014   // DEVICE_SIP_SENDRPID
2015   $set['value'] = 'no';
2016   $set['options'] = array('no', 'yes', 'pai');
2017   $set['name'] = 'SIP sendrpid';
2018   $set['description'] = "Default setting for SIP sendrpid. A value of 'yes' is equivalent to 'rpid' and will send the 'Remote-Party-ID' header. A value of 'pai' is only valid starting with Asterisk 1.8 and will send the 'P-Asserted-Identity' header. See Asterisk documentation for details.";
2019   $set['readonly'] = 0;
2020   $set['type'] = CONF_TYPE_SELECT;
2021   $set['emptyok'] = 0;
2022   $set['sortorder'] = 40;
2023   $freepbx_conf->define_conf_setting('DEVICE_SIP_SENDRPID',$set);
2024
2025   // DEVICE_SIP_NAT
2026   $set['value'] = 'no';
2027   $set['options'] = array('no', 'yes', 'never', 'route');
2028   $set['name'] = 'SIP nat';
2029   $set['description'] = "Default setting for SIP nat. A 'yes' will attempt to handle nat, also works for local (uses the network ports and address instead of the reported ports), 'no' follows the protocol, 'never' tries to block it, no RFC3581, 'route' ignores the rport information. See Asterisk documentation for details.";
2030   $set['readonly'] = 0;
2031   $set['type'] = CONF_TYPE_SELECT;
2032   $set['emptyok'] = 0;
2033   $set['sortorder'] = 50;
2034   $freepbx_conf->define_conf_setting('DEVICE_SIP_NAT',$set);
2035
2036   // DEVICE_SIP_ENCRYPTION
2037   $set['value'] = 'no';
2038   $set['options'] = array('no', 'yes');
2039   $set['name'] = 'SIP encryption';
2040   $set['description'] = "Default setting for SIP encryption. Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. See Asterisk documentation for details.";
2041   $set['readonly'] = 0;
2042   $set['type'] = CONF_TYPE_SELECT;
2043   $set['emptyok'] = 0;
2044   $set['sortorder'] = 60;
2045   $freepbx_conf->define_conf_setting('DEVICE_SIP_ENCRYPTION',$set);
2046
2047   // DEVICE_SIP_QUALIFYFREQ
2048   $set['value'] = 60;
2049   $set['options'] = array(15, 86400);
2050   $set['name'] = 'SIP qualifyfreq';
2051   $set['description'] = "Default setting for SIP qualifyfreq. Only valid for Asterisk 1.6 and above. Frequency that 'qualify' OPTIONS messages will be sent to the device. Can help to keep NAT holes open but not dependable for remote client firewalls. See Asterisk documentation for details.";
2052   $set['readonly'] = 0;
2053   $set['type'] = CONF_TYPE_INT;
2054   $set['emptyok'] = 0;
2055   $set['sortorder'] = 70;
2056   $freepbx_conf->define_conf_setting('DEVICE_SIP_QUALIFYFREQ',$set);
2057
2058   // DEVICE_QUALIFY
2059   $set['value'] = 'yes';
2060   $set['options'] = '';
2061   $set['name'] = 'SIP and IAX qualify';
2062   $set['description'] = "Default setting for SIP and IAX qualify. Whether to send periodic OPTIONS messages (for SIP) or otherwise monitor the channel, and at what point to consider the channel unavailable. A value of 'yes' is equivalent to 2000, time in msec. Can help to keep NAT holes open with SIP but not dependable for remote client firewalls. See Asterisk documentation for details.";
2063   $set['readonly'] = 0;
2064   $set['type'] = CONF_TYPE_TEXT;
2065   $set['emptyok'] = 0;
2066   $set['sortorder'] = 80;
2067   $freepbx_conf->define_conf_setting('DEVICE_QUALIFY',$set);
2068
2069   // DEVICE_DISALLOW
2070   $set['value'] = '';
2071   $set['options'] = '';
2072   $set['name'] = 'SIP and IAX disallow';
2073   $set['description'] = "Default setting for SIP and IAX disallow (for codecs). Codecs to disallow, can help to reset from the general settings by setting a value of 'all' and then specifically including allowed codecs with the 'allow' directive. Values van be separated with '&' e.g. 'g729&g722'. See Asterisk documentation for details.";
2074   $set['readonly'] = 0;
2075   $set['type'] = CONF_TYPE_TEXT;
2076   $set['emptyok'] = 1;
2077   $set['sortorder'] = 90;
2078   $freepbx_conf->define_conf_setting('DEVICE_DISALLOW',$set);
2079
2080   // DEVICE_ALLOW
2081   $set['value'] = '';
2082   $set['options'] = '';
2083   $set['name'] = 'SIP and IAX allow';
2084   $set['description'] = "Default setting for SIP and IAX allow (for codecs). Codecs to allow in addition to those set in general settings unless explicitly 'disallowed' for the device. Values van be separated with '&' e.g. 'ulaw&g729&g729' where the preference order is preserved. See Asterisk documentation for details.";
2085   $set['readonly'] = 0;
2086   $set['type'] = CONF_TYPE_TEXT;
2087   $set['emptyok'] = 1;
2088   $set['sortorder'] = 90;
2089   $freepbx_conf->define_conf_setting('DEVICE_ALLOW',$set);
2090
2091   // DEVICE_CALLGROUP
2092   $set['value'] = '';
2093   $set['options'] = '';
2094   $set['name'] = 'SIP and DAHDi callgroup';
2095   $set['description'] = "Default setting for SIP, DAHDi (and Zap) callgroup. Callgroup(s) that the device is part of, can be one or more callgroups, e.g. '1,3-5' would be in groups 1,3,4,5. See Asterisk documentation for details.";
2096   $set['readonly'] = 0;
2097   $set['type'] = CONF_TYPE_TEXT;
2098   $set['emptyok'] = 1;
2099   $set['sortorder'] = 100;
2100   $freepbx_conf->define_conf_setting('DEVICE_CALLGROUP',$set);
2101
2102   // DEVICE_PICKUPGROUP
2103   $set['value'] = '';
2104   $set['options'] = '';
2105   $set['name'] = 'SIP and DAHDi pickupgroup';
2106   $set['description'] = "Default setting for SIP, DAHDi (and Zap) pickupgroup. Pickupgroups(s) that the device can pickup calls from, can be one or more groups, e.g. '1,3-5' would be in groups 1,3,4,5. Device does not have to be in a group to be able to pickup calls from that group. See Asterisk documentation for details.";
2107   $set['readonly'] = 0;
2108   $set['type'] = CONF_TYPE_TEXT;
2109   $set['emptyok'] = 1;
2110   $set['sortorder'] = 110;
2111   $freepbx_conf->define_conf_setting('DEVICE_PICKUPGROUP',$set);
2112
2113
2114   //
2115   // CATEGORY: Internal Use
2116   //
2117   $set['category'] = 'Internal Use';
2118   $set['level'] = 10;
2119
2120   // MODULE_REPO
2121   $set['value'] = 'http://mirror1.freepbx.org,http://mirror2.freepbx.org';
2122   $set['options'] = '';
2123   $set['name'] = 'Repo Server';
2124   $set['description'] = 'repo server';
2125   $set['readonly'] = 1;
2126   $set['hidden'] = 1;
2127   $set['type'] = CONF_TYPE_TEXT;
2128   $set['emptyok'] = 0;
2129   $freepbx_conf->define_conf_setting('MODULE_REPO',$set);
2130   $set['hidden'] = 0;
2131
2132   // NOTICE_BROWSER_STATS
2133   $set['value'] = false;
2134   $set['options'] = '';
2135   $set['name'] = 'Browser Stats Notice';
2136   $set['description'] = 'Internal use to track if notice has been given that anonyous browser stats are being collected.';
2137   $set['emptyok'] = 0;
2138   $set['readonly'] = 1;
2139   $set['hidden'] = 1;
2140   $set['type'] = CONF_TYPE_BOOL;
2141   $freepbx_conf->define_conf_setting('NOTICE_BROWSER_STATS',$set);
2142   $set['hidden'] = 0;
2143
2144   // ASTCONFAPP
2145   $set['value'] = 'app_meetme';
2146   $set['options'] = array('app_meetme', 'app_confbridge');
2147   $set['defaultval'] =& $set['value'];
2148   $set['readonly'] = 0;
2149   $set['hidden'] = 0;
2150   $set['level'] = 0;
2151   $set['module'] = '';
2152   $set['category'] = 'Dialplan and Operational';
2153   $set['emptyok'] = 0;
2154   $set['name'] = 'Conference Room App';
2155   $set['description'] = 'The asterisk application to use for conferencing. If only one is compiled into asterisk, FreePBX will auto detect and change this value if set wrong. The app_confbridge application is considered "experimental" with known issues and does not work on Asterisk 10 where it was completely rewritten and changed from the version on 1.6 and 1.8.';
2156   $set['type'] = CONF_TYPE_SELECT;
2157   $freepbx_conf->define_conf_setting('ASTCONFAPP', $set);
2158  
2159   //mainstyle_css_generated
2160   $set['value'] = $amp_conf['mainstyle_css_generated'] ? $amp_conf['mainstyle_css_generated'] : '';
2161   $set['description'] = 'internal use';
2162   $set['type'] = CONF_TYPE_TEXT;
2163   $set['defaultval'] = '';
2164   $set['name'] = 'Compressed Copy of Main CSS';
2165   $set['readonly'] = 1;
2166   $set['hidden'] = 1;
2167   $set['emptyok'] = 1;
2168   $freepbx_conf->define_conf_setting('mainstyle_css_generated', $set);
2169  
2170   //JQUERY_VER
2171   $set['value'] = '1.7.1';
2172   $set['options'] = '';
2173   $set['defaultval'] =& $set['value'];
2174   $set['readonly'] = 0;
2175   $set['hidden'] = 1;
2176   $set['level'] = 0;
2177   $set['module'] = '';
2178   $set['category'] = 'System Setup';
2179   $set['emptyok'] = 0;
2180   $set['name'] = 'jQuery Version';
2181   $set['description'] = 'The version of jQuery that we wish to use.';
2182   $set['type'] = CONF_TYPE_TEXT;
2183   $freepbx_conf->define_conf_setting('JQUERY_VER', $set);
2184  
2185   //JQUERYUI_VER
2186   $set['value'] = '1.8.9';
2187   $set['options'] = '';
2188   $set['defaultval'] =& $set['value'];
2189   $set['readonly'] = 0;
2190   $set['hidden'] = 1;
2191   $set['level'] = 0;
2192   $set['module'] = '';
2193   $set['category'] = 'System Setup';
2194   $set['emptyok'] = 0;
2195   $set['name'] = 'jQuery UI Version';
2196   $set['description'] = 'The version of jQuery UI that we wish to use.';
2197   $set['type'] = CONF_TYPE_TEXT;
2198   $freepbx_conf->define_conf_setting('JQUERYUI_VER', $set);
2199  
2200   // The following settings are used in various modules prior to 2.9. If they are found in amportal.conf then we
2201   // retain their values until the individual modules are updated and their install scripts run where a full
2202   // configuration (descriptions, defaults, etc.) will be provided and maintained. This provides just enough to
2203   // carry the setting through the migration since most upgrades will run framework or install_amp followed by the
2204   // module install scripts.
2205   //
2206   $module_migrate['AMPPLAYKEY'] = CONF_TYPE_TEXT;
2207   $module_migrate['AMPBACKUPEMAILFROM'] = CONF_TYPE_TEXT;
2208   $module_migrate['AMPBACKUPSUDO'] = CONF_TYPE_BOOL;
2209   $module_migrate['USEQUEUESTATE'] = CONF_TYPE_BOOL;
2210   $module_migrate['DASHBOARD_INFO_UPDATE_TIME'] = CONF_TYPE_INT;
2211   $module_migrate['DASHBOARD_STATS_UPDATE_TIME'] = CONF_TYPE_INT;
2212   $module_migrate['SSHPORT'] = CONF_TYPE_INT;
2213   $module_migrate['MAXCALLS'] = CONF_TYPE_INT;
2214   $module_migrate['AMPMPG123'] = CONF_TYPE_BOOL;
2215   $module_migrate['PARKINGPATCH'] = CONF_TYPE_BOOL;
2216
2217   $mod_set['value'] = '';
2218   $mod_set['defaultval'] = '';
2219   $mod_set['readonly'] = 0;
2220   $mod_set['hidden'] = 1;
2221   $mod_set['level'] = 10;
2222   $mod_set['module'] = '';
2223   $mod_set['category'] = 'Under Migration';
2224   $mod_set['emptyok'] = 1;
2225   $mod_set['description'] = 'This setting is being migrated and will be initialized by its module install script on upgrade.';
2226   foreach ($module_migrate as $setting => $type) {
2227     if (isset($amp_conf[$setting])  && !$freepbx_conf->conf_setting_exists($setting)) {
2228       $val = $amp_conf[$setting];
2229
2230       // since this came from a conf file, change any 'false' that will otherwise turn to true
2231       //
2232       if ($type == CONF_TYPE_BOOL) switch (strtolower($val)) {
2233       case 'false':
2234       case 'no':
2235       case 'off':
2236         $val = false;
2237       break;
2238       }
2239       $mod_set['value'] = $val;
2240       $mod_set['type'] = $type;
2241       $freepbx_conf->define_conf_setting($setting,$mod_set);
2242     }
2243   }
2244
2245   if ($commit_to_db) {
2246     $freepbx_conf->commit_conf_settings();
2247   }
2248 }
Note: See TracBrowser for help on using the browser.