root/freepbx/trunk/libfreepbx.install.php

Revision 12549, 88.3 kB (checked in by p_lindheimer, 5 months ago)

Merged revisions 12168,12170,12172,12183,12205,12221,12226-12229,12231,12235,12237,12250,12321,12357,12363,12467,12476,12529 via svnmerge from
http://www.freepbx.org/v2/svn/freepbx/branches/2.9

........

r12168 | GameGamer?43 | 2011-05-19 15:49:56 -0700 (Thu, 19 May 2011) | 1 line


closes #5160 - goes back to how things where done prior to r12066 with the exception that utility.functions.php is included where bootstrap-utility.functions.php used to be

........

r12170 | p_lindheimer | 2011-05-20 08:26:04 -0700 (Fri, 20 May 2011) | 1 line


remove 2.9.0.md5 checksum to regenerate 2.9.0 tag

........

r12172 | p_lindheimer | 2011-05-20 08:28:23 -0700 (Fri, 20 May 2011) | 1 line


Creating release 2.9.0

........

r12183 | p_lindheimer | 2011-05-20 16:32:04 -0700 (Fri, 20 May 2011) | 1 line


fixes #5138 make restrict_mods local and also detect and skip bootstrap if already called

........

r12205 | p_lindheimer | 2011-06-03 09:10:17 -0700 (Fri, 03 Jun 2011) | 1 line


fixed #5194 fix logic flaw so agi scripts can be copied after first module install

........

r12221 | mbrevda | 2011-06-07 08:32:39 -0700 (Tue, 07 Jun 2011) | 1 line


re #5209, write_freepbx should use AMPDBNAME for the db name, not AMPENGINE.

........

r12226 | p_lindheimer | 2011-06-09 15:23:24 -0700 (Thu, 09 Jun 2011) | 1 line


fixes #5217 don't return stripped version of xml to Module Admin

........

r12227 | p_lindheimer | 2011-06-09 15:29:41 -0700 (Thu, 09 Jun 2011) | 1 line


point to 2.9 modules re #5221 - need to rebuild tarball before closing

........

r12228 | p_lindheimer | 2011-06-09 15:53:54 -0700 (Thu, 09 Jun 2011) | 1 line


fixes #5212 if ASTAGIDIR is defined, chown even if it's already been done above through ASTVARLIBDIR...

........

r12229 | p_lindheimer | 2011-06-09 16:08:05 -0700 (Thu, 09 Jun 2011) | 1 line


fixes #5211 make amportal.conf and freepbx.conf 640 permission

........

r12231 | p_lindheimer | 2011-06-11 10:40:16 -0700 (Sat, 11 Jun 2011) | 1 line


closes #5226 include fw_ari and fw_fop in tarball

........

r12235 | p_lindheimer | 2011-06-11 12:17:07 -0700 (Sat, 11 Jun 2011) | 1 line


remove md5 hashes in preperation for re-generating 2.9.0 tarball because of 2.8 modules re #5221

........

r12237 | p_lindheimer | 2011-06-11 12:19:09 -0700 (Sat, 11 Jun 2011) | 1 line


Creating release 2.9.0

........

r12250 | p_lindheimer | 2011-06-11 12:25:01 -0700 (Sat, 11 Jun 2011) | 1 line


special case fw_ari and fw_fop during install_amp as framework re #5227

........

r12321 | mickecarlsson | 2011-07-26 07:43:52 -0700 (Tue, 26 Jul 2011) | 1 line


Closes #5280 revert some of r11047.

........

r12357 | xrobau | 2011-08-04 14:30:20 -0700 (Thu, 04 Aug 2011) | 1 line


Minor fixes for installer, and add the ability to symlink any asterisk path to elsewhere, and it'll still work.

........

r12363 | mickecarlsson | 2011-08-07 12:47:11 -0700 (Sun, 07 Aug 2011) | 1 line


Updated amp.pot for 2.9, should have been submitted a long time ago

........

r12467 | GameGamer?43 | 2011-08-30 15:43:20 -0700 (Tue, 30 Aug 2011) | 1 line


check if the readlink is valid before trying to chown & chmod directories to avoid displaying errors in the event the directories are not there or the user sets this to something else which isnt valid

........

r12476 | mickecarlsson | 2011-09-02 08:52:19 -0700 (Fri, 02 Sep 2011) | 1 line


Close #5348, updated Russian language. Thank you ded

........

r12529 | mickecarlsson | 2011-09-18 02:26:52 -0700 (Sun, 18 Sep 2011) | 1 line


Close #5352, double quotes in string for Advanced Settings should be single quotes and the string itself should be in double quotes.

........

  • 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 upgrades found");
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       if (strpos($destination,"htdocs_panel")) {
259         $destination=str_replace("/htdocs_panel",trim($amp_conf["FOPWEBROOT"]),$destination);
260       } else {
261         $destination=str_replace("/htdocs",trim($amp_conf["AMPWEBROOT"]),$destination);
262       }
263       $destination=str_replace("/htdocs_panel",trim($amp_conf["FOPWEBROOT"]),$destination);
264 //      $destination=str_replace("/cgi-bin",trim($amp_conf["AMPCGIBIN"]),$destination);
265       if(strpos($dirsource, 'modules') === false) $destination=str_replace("/bin",trim($amp_conf["AMPBIN"]),$destination);
266       $destination=str_replace("/sbin",trim($amp_conf["AMPSBIN"]),$destination);
267      
268       // the following are configurable in asterisk.conf
269       $destination=str_replace("/astetc",trim($asterisk_conf["astetcdir"]),$destination);
270       $destination=str_replace("/moh",trim($asterisk_conf["astvarlibdir"])."/$moh_subdir",$destination);
271       $destination=str_replace("/astvarlib",trim($asterisk_conf["astvarlibdir"]),$destination);
272       if(strpos($dirsource, 'modules') === false) $destination=str_replace("/agi-bin",trim($asterisk_conf["astagidir"]),$destination);
273       if(strpos($dirsource, 'modules') === false) $destination=str_replace("/sounds",trim($asterisk_conf["astvarlibdir"])."/sounds",$destination);
274
275       // if this is a directory, ensure destination exists
276       if (is_dir($source)) {
277         if (!file_exists($destination)) {
278           if ((!$dryrun) && ($destination != "")) {
279             amp_mkdir($destination, "0750", true);
280           }
281         }
282       }
283      
284       //var_dump($md5sums);
285       if (!is_dir($source)) {
286         $md5_source = preg_replace("|^/?amp_conf/|", "/", $source);
287
288         if ($check_md5s && file_exists($destination) && isset($md5sums[$md5_source]) && (md5_file($destination) != $md5sums[$md5_source])) {
289           // double check using diff utility (and ignoring whitespace)
290           // This is a somewhat edge case (eg, the file doesn't match
291           // it's md5 sum from the previous version, but no substantial
292           // changes exist compared to the current version), but it
293           // prevents a useless prompt to the user.
294           if (checkDiff($source, $destination)) {
295             $overwrite = ask_overwrite($source, $destination);
296           } else {
297             debug("NOTE: MD5 for ".$destination." was different, but `diff` did not detect any (non-whitespace) changes: overwriting");
298             $overwrite = true;
299           }
300         } else {
301           $overwrite = true;
302         }
303        
304         // These are modified by apply_conf.sh, there may be others that fit in this category also. This keeps these from
305         // being symlinked and then developers inadvertently checking in the changes when they should not have.
306         //
307         $never_symlink = array("cdr_mysql.conf", "manager.conf", "vm_email.inc");
308
309         $num_files++;
310         if ($overwrite) {
311           debug(($make_links ? "link" : "copy")." ".$source." -> ".$destination);
312           if (!$dryrun) {
313             if ($make_links && !in_array(basename($source),$never_symlink)) {
314               // symlink, unlike copy, doesn't overwrite - have to delete first
315               if (is_link($destination) || file_exists($destination)) {
316                 unlink($destination);
317               }
318               symlink($_ENV["PWD"]."/".$source, $destination);
319             } else {
320               copy($source, $destination);
321             }
322             $num_copied++;
323           }
324         } else {
325           debug("not overwriting ".$destination);
326         }
327       } else {
328         //echo "recursive_copy($dirsourceparent, $dirdest, $md5sums, $dirsource/$file)";
329         list($tmp_num_files, $tmp_num_copied) = recursive_copy($dirsourceparent, $dirdest, $md5sums, $dirsource."/".$file);
330         $num_files += $tmp_num_files;
331         $num_copied += $tmp_num_copied;
332       }
333     }
334   }
335  
336   if (isset($dir_handle)) closedir($dir_handle);
337  
338   return array($num_files, $num_copied);
339 }
340
341 function read_md5_file($filename) {
342   $md5 = array();
343   if (file_exists($filename)) {
344     foreach (file($filename) as $line) {
345       if (preg_match("/^([a-f0-9]{32})\s+(.*)$/", $line, $matches)) {
346         $md5[ "/".$matches[2] ] = $matches[1];
347       }
348     }
349   }
350   return $md5;
351 }
352
353 /** Include a .php file
354  * This is a function just to keep a separate context
355  */
356 function run_included($file) {
357   global $db;
358   global $amp_conf;
359  
360   include($file);
361 }
362
363 function install_sqlupdate( $version, $file )
364 {
365   global $db;
366   global $dryrun;
367
368   out("-> Running SQL script ".UPGRADE_DIR."/".$version."/".$file);
369   // run sql script
370   $fd = fopen(UPGRADE_DIR."/".$version."/".$file, "r");
371   $data = "";
372   while (!feof($fd)) {
373     $data .= fread($fd, 1024);
374   }
375   fclose($fd);
376
377   preg_match_all("/((SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER).*);\s*\n/Us", $data, $matches);
378  
379   foreach ($matches[1] as $sql) {
380     debug($sql);
381     if (!$dryrun) {
382       $result = $db->query($sql);
383       if(DB::IsError($result)) {     
384         fatal($result->getDebugInfo()."\" while running ".$file."\n");
385       }
386     }
387   }
388 }
389
390 /********************************************************************************************************************/
391 /*                          FREEPBX SETTINGS (AMPORTAL.CONF) DEFINED HERE                                           */
392 /********************************************************************************************************************/
393 //
394 // TODO: find a good way to extract the required localization strings for the tools to pickup
395 //
396 // freepbx_settings_init()
397 // this is where we initialize all the freepbx_settings (amportal.conf). This will be run with install_amp and every
398 // time we run the framework installer, so new settings can be added here that are framework wide. It may make send to
399 // break this out separately but for now we'll keep it here since this is already part of the infrastructure that is
400 // used by both install_amp and the framework install/upgrade script.
401 //
402 function freepbx_settings_init($commit_to_db = false) {
403   global $amp_conf;
404
405   include_once ($amp_conf['AMPWEBROOT'].'/admin/libraries/freepbx_conf.class.php');
406
407   $freepbx_conf =& freepbx_conf::create();
408
409   $set['value'] = '';
410   $set['defaultval'] =& $set['value'];
411   $set['readonly'] = 0;
412   $set['hidden'] = 0;
413   $set['level'] = 0;
414   $set['module'] = '';
415   $set['emptyok'] = 0;
416
417
418   //
419   // CATEGORY: Advanced Settings Display
420   //
421   $set['category'] = 'Advanced Settings Details';
422
423   /* This was too confusing, will remove for now and re-evaluate if needed
424   // AS_DISPLAY_DETAIL_LEVEL
425   $set['value'] = '0';
426   $set['options'] = '0,1,2,3,4,5,6,7,8,9,10';
427   $set['name'] = 'Display Detail Level';
428   $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.';
429   $set['emptyok'] = 0;
430   $set['level'] = 0;
431   $set['readonly'] = 0;
432   $set['type'] = CONF_TYPE_SELECT;
433   $freepbx_conf->define_conf_setting('AS_DISPLAY_DETAIL_LEVEL',$set);
434   $set['readonly'] = 0;
435   $set['level'] = 0;
436   */
437
438   // AS_DISPLAY_HIDDEN_SETTINGS
439   $set['value'] = false;
440   $set['options'] = '';
441   $set['name'] = 'Display Hidden Settings';
442   $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.';
443   $set['emptyok'] = 0;
444   $set['level'] = 0;
445   $set['readonly'] = 0;
446   $set['type'] = CONF_TYPE_BOOL;
447   $freepbx_conf->define_conf_setting('AS_DISPLAY_HIDDEN_SETTINGS',$set);
448   $set['readonly'] = 0;
449   $set['level'] = 0;
450
451   // AS_DISPLAY_READONLY_SETTINGS
452   $set['value'] = false;
453   $set['options'] = '';
454   $set['name'] = 'Display Readonly Settings';
455   $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.';
456   $set['emptyok'] = 0;
457   $set['level'] = 0;
458   $set['readonly'] = 0;
459   $set['type'] = CONF_TYPE_BOOL;
460   $freepbx_conf->define_conf_setting('AS_DISPLAY_READONLY_SETTINGS',$set);
461   $set['readonly'] = 0;
462   $set['level'] = 0;
463
464   // AS_OVERRIDE_READONLY
465   $set['value'] = false;
466   $set['options'] = '';
467   $set['name'] = 'Override Readonly Settings';
468   $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.';
469   $set['emptyok'] = 0;
470   $set['level'] = 0;
471   $set['readonly'] = 0;
472   $set['type'] = CONF_TYPE_BOOL;
473   $freepbx_conf->define_conf_setting('AS_OVERRIDE_READONLY',$set);
474   $set['readonly'] = 0;
475   $set['level'] = 0;
476
477   // AS_DISPLAY_FRIENDLY_NAME
478   $set['value'] = true;
479   $set['options'] = '';
480   $set['name'] = 'Display Friendly Name';
481   $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..';
482   $set['emptyok'] = 0;
483   $set['level'] = 0;
484   $set['readonly'] = 0;
485   $set['type'] = CONF_TYPE_BOOL;
486   $freepbx_conf->define_conf_setting('AS_DISPLAY_FRIENDLY_NAME',$set);
487   $set['readonly'] = 0;
488   $set['level'] = 0;
489
490   //
491   // CATEGORY: System Setup
492   //
493   $set['category'] = 'System Setup';
494
495   // AMPSYSLOGLEVEL
496   $set['value'] = 'FILE';
497   $set['options'] = 'FILE, LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG';
498   // 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
499   // writeable for a while.
500   //
501   if (isset($amp_conf['AMPSYSLOGLEVEL']) && (strtoupper($amp_conf['AMPSYSLOGLEVEL']) == 'SQL' || strtoupper($amp_conf['AMPSYSLOGLEVEL']) == 'LOG_SQL')) {
502     $set['options'] .= ', LOG_SQL, SQL';
503   }
504   $set['name'] = 'FreePBX Log Routing';
505   $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.";
506   $set['emptyok'] = 0;
507   $set['readonly'] = 0;
508   $set['sortorder'] = -190;
509   $set['type'] = CONF_TYPE_SELECT;
510   $freepbx_conf->define_conf_setting('AMPSYSLOGLEVEL',$set);
511
512   // AMPDISABLELOG
513   $set['value'] = false;
514   $set['options'] = '';
515   $set['name'] = 'Disable FreePBX Log';
516   $set['description'] = 'Whether or not to invoke the FreePBX log facility.';
517   $set['emptyok'] = 0;
518   $set['readonly'] = 0;
519   $set['sortorder'] = -180;
520   $set['type'] = CONF_TYPE_BOOL;
521   $freepbx_conf->define_conf_setting('AMPDISABLELOG',$set);
522
523   // LOG_OUT_MESSAGES
524   $set['value'] = true;
525   $set['options'] = '';
526   $set['name'] = 'Log Verbose Messages';
527   $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.';
528   $set['emptyok'] = 0;
529   $set['readonly'] = 0;
530   $set['sortorder'] = -170;
531   $set['type'] = CONF_TYPE_BOOL;
532   $freepbx_conf->define_conf_setting('LOG_OUT_MESSAGES',$set);
533
534   // LOG_NOTIFICATIONS
535   $set['value'] = true;
536   $set['options'] = '';
537   $set['name'] = 'Send Dashboard Notifications to Log';
538   $set['description'] = 'When enabled all notification updates to the Dashboard notification panel will also be logged into the specified log file when enabled.';
539   $set['emptyok'] = 0;
540   $set['readonly'] = 0;
541   $set['sortorder'] = -160;
542   $set['type'] = CONF_TYPE_BOOL;
543   $freepbx_conf->define_conf_setting('LOG_NOTIFICATIONS',$set);
544
545   // FPBX_LOG_FILE
546   $set['value'] = '/var/log/asterisk/freepbx.log';
547   $set['options'] = '';
548   $set['name'] = 'FreePBX Log File';
549   $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.';
550   $set['emptyok'] = 0;
551   $set['readonly'] = 0;
552   $set['sortorder'] = -150;
553   $set['type'] = CONF_TYPE_TEXT;
554   $freepbx_conf->define_conf_setting('FPBX_LOG_FILE',$set);
555
556   // PHP_ERROR_HANDLER_OUTPUT
557   $set['value'] = 'dbug';
558   $set['options'] = array('dbug','freepbxlog','off');
559   $set['name'] = 'PHP Error Log Output';
560   $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.";
561   $set['emptyok'] = 0;
562   $set['readonly'] = 0;
563   $set['sortorder'] = -140;
564   $set['type'] = CONF_TYPE_SELECT;
565   $freepbx_conf->define_conf_setting('PHP_ERROR_HANDLER_OUTPUT',$set);
566
567   // AMPEXTENSIONS
568   $set['value'] = 'extensions';
569   $set['options'] = 'extensions,deviceanduser';
570   $set['name'] = 'User & Devices Mode';
571   $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.';
572   $set['emptyok'] = 0;
573   $set['readonly'] = 0;
574   $set['sortorder'] = -135;
575   $set['type'] = CONF_TYPE_SELECT;
576   $freepbx_conf->define_conf_setting('AMPEXTENSIONS',$set);
577
578   // AUTHTYPE
579   $set['value'] = 'database';
580   $set['options'] = 'database,none,webserver';
581   $set['name'] = 'Authorization Type';
582   $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.';
583   $set['emptyok'] = 0;
584   $set['level'] = 3;
585   $set['readonly'] = 1;
586   $set['sortorder'] = -130;
587   $set['type'] = CONF_TYPE_SELECT;
588   $freepbx_conf->define_conf_setting('AUTHTYPE',$set);
589   $set['level'] = 0;
590
591   // AMP_ACCESS_DB_CREDS
592   $set['value'] = false;
593   $set['options'] = '';
594   $set['name'] = 'Allow Login With DB Credentials';
595   $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.";
596   $set['emptyok'] = 0;
597   $set['readonly'] = 0;
598   $set['sortorder'] = -126;
599   $set['type'] = CONF_TYPE_BOOL;
600   $freepbx_conf->define_conf_setting('AMP_ACCESS_DB_CREDS',$set);
601
602   // ARI_ADMIN_USERNAME
603   $set['value'] = '';
604   $set['options'] = '';
605   $set['name'] = 'User Portal Admin Username';
606   $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';
607   $set['emptyok'] = 1;
608   $set['readonly'] = 0;
609   $set['sortorder'] = -120;
610   $set['type'] = CONF_TYPE_TEXT;
611   $freepbx_conf->define_conf_setting('ARI_ADMIN_USERNAME',$set);
612
613   // ARI_ADMIN_PASSWORD
614   $set['value'] = 'ari_password';
615   $set['options'] = '';
616   $set['name'] = 'User Portal Admin Password';
617   $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';
618   $set['emptyok'] = 0;
619   $set['readonly'] = 0;
620   $set['sortorder'] = -110;
621   $set['type'] = CONF_TYPE_TEXT;
622   $freepbx_conf->define_conf_setting('ARI_ADMIN_PASSWORD',$set);
623
624   // FORCED_ASTVERSION
625   $set['value'] = '';
626   $set['options'] = '';
627   $set['name'] = 'Force Asterisk Version';
628   $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.';
629   $set['emptyok'] = 1;
630   $set['readonly'] = 1;
631   $set['sortorder'] = -100;
632   $set['type'] = CONF_TYPE_TEXT;
633   $set['level'] = 4;
634   $freepbx_conf->define_conf_setting('FORCED_ASTVERSION',$set);
635   $set['level'] = 0;
636
637   // AMPENGINE
638   $set['value'] = 'asterisk';
639   $set['options'] = 'asterisk';
640   $set['name'] = 'Telephony Engine';
641   $set['description'] = 'The telephony backend engine being used, asterisk is the only option currently.';
642   $set['emptyok'] = 0;
643   $set['level'] = 3;
644   $set['readonly'] = 1;
645   $set['type'] = CONF_TYPE_SELECT;
646   $freepbx_conf->define_conf_setting('AMPENGINE',$set);
647   $set['level'] = 0;
648
649   // AMPVMUMASK
650   $set['value'] = '007';
651   $set['options'] = '';
652   $set['name'] = 'Asterisk VMU Mask';
653   $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.';
654   $set['emptyok'] = 0;
655   $set['readonly'] = 0;
656   $set['type'] = CONF_TYPE_TEXT;
657   $set['level'] = 4;
658   $freepbx_conf->define_conf_setting('AMPVMUMASK',$set);
659   $set['level'] = 0;
660
661   // AMPWEBADDRESS
662   $set['value'] = '';
663   $set['options'] = '';
664   $set['name'] = 'FreePBX Web Address';
665   $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.';
666   $set['emptyok'] = 1;
667   $set['readonly'] = 0;
668   $set['type'] = CONF_TYPE_TEXT;
669   $set['level'] = 4;
670   $freepbx_conf->define_conf_setting('AMPWEBADDRESS',$set);
671   $set['level'] = 0;
672
673   // AMPASTERISKUSER
674   $set['value'] = 'asterisk';
675   $set['options'] = '';
676   $set['name'] = 'System Asterisk User';
677   $set['description'] = 'The user Asterisk should be running as, used by freepbx_engine. Most systems should not change this.';
678   $set['emptyok'] = 0;
679   $set['type'] = CONF_TYPE_TEXT;
680   $set['level'] = 4;
681   $set['readonly'] = 1;
682   $freepbx_conf->define_conf_setting('AMPASTERISKUSER',$set);
683   $set['level'] = 0;
684
685   // AMPASTERISKGROUP
686   $set['value'] = 'asterisk';
687   $set['options'] = '';
688   $set['name'] = 'System Asterisk Group';
689   $set['description'] = 'The user group Asterisk should be running as, used by freepbx_engine. Most systems should not change this.';
690   $set['emptyok'] = 0;
691   $set['type'] = CONF_TYPE_TEXT;
692   $set['level'] = 4;
693   $set['readonly'] = 1;
694   $freepbx_conf->define_conf_setting('AMPASTERISKGROUP',$set);
695   $set['level'] = 0;
696
697   // AMPASTERISKWEBUSER
698   $set['value'] = 'asterisk';
699   $set['options'] = '';
700   $set['name'] = 'System Web User';
701   $set['description'] = 'The user your httpd should be running as, used by freepbx_engine. Most systems should not change this.';
702   $set['emptyok'] = 0;
703   $set['type'] = CONF_TYPE_TEXT;
704   $set['level'] = 4;
705   $set['readonly'] = 1;
706   $freepbx_conf->define_conf_setting('AMPASTERISKWEBUSER',$set);
707   $set['level'] = 0;
708
709   // AMPASTERISKWEBGROUP
710   $set['value'] = 'asterisk';
711   $set['options'] = '';
712   $set['name'] = 'System Web Group';
713   $set['description'] = 'The user group your httpd should be running as, used by freepbx_engine. Most systems should not change this.';
714   $set['emptyok'] = 0;
715   $set['type'] = CONF_TYPE_TEXT;
716   $set['level'] = 4;
717   $set['readonly'] = 1;
718   $freepbx_conf->define_conf_setting('AMPASTERISKWEBGROUP',$set);
719   $set['level'] = 0;
720
721   // AMPDEVUSER
722   $set['value'] = 'asterisk';
723   $set['options'] = '';
724   $set['name'] = 'System Device User';
725   $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.';
726   $set['emptyok'] = 0;
727   $set['type'] = CONF_TYPE_TEXT;
728   $set['level'] = 4;
729   $set['readonly'] = 1;
730   $freepbx_conf->define_conf_setting('AMPDEVUSER',$set);
731   $set['level'] = 0;
732
733   // AMPDEVGROUP
734   $set['value'] = 'asterisk';
735   $set['options'] = '';
736   $set['name'] = 'System Device Group';
737   $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.';
738   $set['emptyok'] = 0;
739   $set['readonly'] = 1;
740   $set['type'] = CONF_TYPE_TEXT;
741   $set['level'] = 4;
742   $freepbx_conf->define_conf_setting('AMPDEVGROUP',$set);
743   $set['level'] = 0;
744
745   //
746   // CATEGORY: Dialplan and Operational
747   //
748   $set['category'] = 'Dialplan and Operational';
749
750   // AMPBADNUMBER
751   $set['value'] = true;
752   $set['options'] = '';
753   $set['name'] = 'Use bad-number Context';
754   $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.';
755   $set['emptyok'] = 0;
756   $set['readonly'] = 0;
757   $set['type'] = CONF_TYPE_BOOL;
758   $set['level'] = 2;
759   $freepbx_conf->define_conf_setting('AMPBADNUMBER',$set);
760   $set['level'] = 0;
761
762   // CWINUSEBUSY
763   $set['value'] = true;
764   $set['options'] = '';
765   $set['name'] = 'Occupied Lines CW Busy';
766   $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>.';
767   $set['emptyok'] = 0;
768   $set['readonly'] = 0;
769   $set['type'] = CONF_TYPE_BOOL;
770   $freepbx_conf->define_conf_setting('CWINUSEBUSY',$set);
771
772   // ZAP2DAHDICOMPAT
773   $set['value'] = false;
774   $set['options'] = '';
775   $set['name'] = 'Convert ZAP Settings to DAHDi';
776   $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.';
777   $set['emptyok'] = 0;
778   $set['readonly'] = 1;
779   $set['type'] = CONF_TYPE_BOOL;
780   $freepbx_conf->define_conf_setting('ZAP2DAHDICOMPAT',$set);
781
782   // DYNAMICHINTS
783   $set['value'] = false;
784   $set['options'] = '';
785   $set['name'] = 'Dynamically Generate Hints';
786   $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.';
787   $set['emptyok'] = 0;
788   $set['readonly'] = 1;
789   $set['type'] = CONF_TYPE_BOOL;
790   $freepbx_conf->define_conf_setting('DYNAMICHINTS',$set);
791
792   // ENABLECW
793   $set['value'] = true;
794   $set['options'] = '';
795   $set['name'] = 'CW Enabled by Default';
796   $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.';
797   $set['emptyok'] = 0;
798   $set['readonly'] = 0;
799   $set['type'] = CONF_TYPE_BOOL;
800   $freepbx_conf->define_conf_setting('ENABLECW',$set);
801
802   // FCBEEPONLY
803   $set['value'] = false;
804   $set['options'] = '';
805   $set['name'] = 'Feature Codes Beep Only';
806   $set['description'] = 'When set to true, a beep is played instead of confirmation message when activating/de-activating: CallForward, CallWaiting, DayNight, DoNotDisturb and FindMeFollow.';
807   $set['emptyok'] = 0;
808   $set['readonly'] = 0;
809   $set['type'] = CONF_TYPE_BOOL;
810   $freepbx_conf->define_conf_setting('FCBEEPONLY',$set);
811
812   // USEDEVSTATE
813   $set['value'] = false;
814   $set['options'] = '';
815   $set['name'] = 'Enable Custom Device States';
816   $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';
817   $set['emptyok'] = 0;
818   $set['readonly'] = 0;
819   $set['type'] = CONF_TYPE_BOOL;
820   $freepbx_conf->define_conf_setting('USEDEVSTATE',$set);
821
822   // USEGOOGLEDNSFORENUM
823   $set['value'] = false;
824   $set['options'] = '';
825   $set['name'] = 'Use Google DNS for Enum';
826   $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>.';
827   $set['emptyok'] = 0;
828   $set['type'] = CONF_TYPE_BOOL;
829   $set['level'] = 2;
830   $set['readonly'] = 0;
831   $freepbx_conf->define_conf_setting('USEGOOGLEDNSFORENUM',$set);
832   $set['level'] = 0;
833
834   // DISABLECUSTOMCONTEXTS
835   $set['value'] = false;
836   $set['options'] = '';
837   $set['name'] = 'Disable -custom Context Includes';
838   $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.';
839   $set['emptyok'] = 0;
840   $set['readonly'] = 0;
841   $set['type'] = CONF_TYPE_BOOL;
842   $set['level'] = 2;
843   $freepbx_conf->define_conf_setting('DISABLECUSTOMCONTEXTS',$set);
844   $set['level'] = 0;
845
846
847   // NOOPTRACE
848   $set['value'] = '0';
849   $set['options'] = '0,1,2,3,4,5,6,7,8,9,10';
850   $set['name'] = 'NoOp Traces in Dialplan';
851   $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';
852   $set['emptyok'] = 0;
853   $set['readonly'] = 0;
854   $set['type'] = CONF_TYPE_SELECT;
855   $freepbx_conf->define_conf_setting('NOOPTRACE',$set);
856
857   // DIVERSIONHEADER
858   $set['value'] = false;
859   $set['options'] = '';
860   $set['name'] = 'Generate Diversion Headers';
861   $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.';
862   $set['emptyok'] = 0;
863   $set['readonly'] = 0;
864   $set['type'] = CONF_TYPE_BOOL;
865   $freepbx_conf->define_conf_setting('DIVERSIONHEADER',$set);
866
867   // CFRINGTIMERDEFAULT
868   $opts = array();
869   for ($i=-1;$i<=120;$i++) {
870       $opts[]=$i;
871   }
872   $set['value'] = '0';
873   $set['options'] = $opts;
874   $set['name'] = 'Call Forward Ringtimer Default';
875   $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.';
876   $set['emptyok'] = 0;
877   $set['readonly'] = 0;
878   $set['type'] = CONF_TYPE_SELECT;
879   $freepbx_conf->define_conf_setting('CFRINGTIMERDEFAULT',$set);
880   unset($opts); 
881  
882   // DEFAULT_INTERNAL_AUTO_ANSWER
883   $set['value'] = 'disabled';
884   $set['options'] = array('disabled','intercom');
885   $set['name'] = 'Internal Auto Answer Default';
886   $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.";
887   $set['emptyok'] = 0;
888   $set['readonly'] = 0;
889   $set['type'] = CONF_TYPE_SELECT;
890   $freepbx_conf->define_conf_setting('DEFAULT_INTERNAL_AUTO_ANSWER',$set);
891
892   // FORCE_INTERNAL_AUTO_ANSWER_ALL
893   $set['value'] = false;
894   $set['options'] = '';
895   $set['name'] = 'Force All Internal Auto Answer';
896   $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.";
897   $set['emptyok'] = 0;
898   $set['readonly'] = 0;
899   $set['type'] = CONF_TYPE_BOOL;
900   $freepbx_conf->define_conf_setting('FORCE_INTERNAL_AUTO_ANSWER_ALL',$set);
901
902   // CONCURRENCYLIMITDEFAULT
903   $opts = array();
904   for ($i=0;$i<=120;$i++) {
905       $opts[]=$i;
906   }
907   $set['value'] = '0';
908   $set['options'] = $opts;
909   $set['name'] = 'Extension Concurrency Limit';
910   $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.';
911   $set['emptyok'] = 0;
912   $set['readonly'] = 0;
913   $set['type'] = CONF_TYPE_SELECT;
914   $freepbx_conf->define_conf_setting('CONCURRENCYLIMITDEFAULT',$set);
915   unset($opts); 
916
917   // BLOCK_OUTBOUND_TRUNK_CNAM
918   $set['value'] = false;
919   $set['options'] = '';
920   $set['name'] = 'Block CNAM on External Trunks';
921   $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.";
922   $set['emptyok'] = 0;
923   $set['readonly'] = 0;
924   $set['type'] = CONF_TYPE_BOOL;
925   $freepbx_conf->define_conf_setting('BLOCK_OUTBOUND_TRUNK_CNAM',$set);
926
927   // ASTSTOPTIMEOUT
928   $opts = array();
929   $set['value'] = '120';
930   $set['options'] = array(0,5,10,30,60,120,300,600,1800,3600,7200,10800);
931   $set['name'] = 'Waiting Period to Stop Asterisk';
932   $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";
933   $set['emptyok'] = 0;
934   $set['readonly'] = 0;
935   $set['type'] = CONF_TYPE_SELECT;
936   $freepbx_conf->define_conf_setting('ASTSTOPTIMEOUT',$set);
937
938   // ASTSTOPPOLLINT
939   $opts = array();
940   $set['value'] = '2';
941   $set['options'] = array(1,2,3,5,10);
942   $set['name'] = 'Polling Interval for Stopping Asterisk';
943   $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.";
944   $set['emptyok'] = 0;
945   $set['readonly'] = 0;
946   $set['type'] = CONF_TYPE_SELECT;
947   $freepbx_conf->define_conf_setting('ASTSTOPPOLLINT',$set);
948
949   // CID_PREPEND_REPLACE
950   $set['value'] = true;
951   $set['options'] = '';
952   $set['name'] = 'Only Use Last CID Prepend';
953   $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.";
954   $set['emptyok'] = 0;
955   $set['readonly'] = 0;
956   $set['type'] = CONF_TYPE_BOOL;
957   $freepbx_conf->define_conf_setting('CID_PREPEND_REPLACE',$set);
958
959   // DITECH_VQA_INBOUND
960   $set['value'] = '7';
961   $set['options'] = array(0,1,2,3,4,5,6,7);
962   $set['name'] = 'Ditech VQA Inbound Setting';
963   $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.";
964   $set['emptyok'] = 0;
965   $set['readonly'] = 0;
966   $set['type'] = CONF_TYPE_SELECT;
967   $freepbx_conf->define_conf_setting('DITECH_VQA_INBOUND',$set);
968
969   // DITECH_VQA_OUTBOUND
970   $set['value'] = '7';
971   $set['options'] = array(0,1,2,3,4,5,6,7);
972   $set['name'] = 'Ditech VQA Outbound Setting';
973   $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.";
974   $set['emptyok'] = 0;
975   $set['readonly'] = 0;
976   $set['type'] = CONF_TYPE_SELECT;
977   $freepbx_conf->define_conf_setting('DITECH_VQA_OUTBOUND',$set);
978
979
980   //
981   // CATEGORY: Directory Layout
982   //
983   $set['category'] = 'Directory Layout';
984
985   // AMPBIN
986   $set['value'] = '/var/lib/asterisk/bin';
987   $set['options'] = '';
988   $set['name'] = 'FreePBX bin Dir';
989   $set['description'] = 'Location of the FreePBX command line scripts.';
990   $set['emptyok'] = 0;
991   $set['readonly'] = 1;
992   $set['type'] = CONF_TYPE_DIR;
993   $set['level'] = 4;
994   $freepbx_conf->define_conf_setting('AMPBIN',$set);
995
996   // AMPSBIN
997   $set['value'] = '/usr/sbin';
998   $set['options'] = '';
999   $set['name'] = 'FreePBX sbin Dir';
1000   $set['description'] = 'Where (root) command line scripts are located.';
1001   $set['emptyok'] = 0;
1002   $set['readonly'] = 1;
1003   $set['type'] = CONF_TYPE_DIR;
1004   $set['level'] = 4;
1005   $freepbx_conf->define_conf_setting('AMPSBIN',$set);
1006    
1007   // AMPWEBROOT
1008   $set['value'] = '/var/www/html';
1009   $set['options'] = '';
1010   $set['name'] = 'FreePBX Web Root Dir';
1011   $set['description'] = 'The path to Apache webroot (leave off trailing slash).';
1012   $set['emptyok'] = 0;
1013   $set['readonly'] = 1;
1014   $set['type'] = CONF_TYPE_DIR;
1015   $set['level'] = 4;
1016   $freepbx_conf->define_conf_setting('AMPWEBROOT',$set);
1017
1018   // ASTAGIDIR
1019   $set['value'] = '/var/lib/asterisk/agi-bin';
1020   $set['options'] = '';
1021   $set['name'] = 'Asterisk AGI Dir';
1022   $set['description'] = 'This is the default directory for Asterisks agi files.';
1023   $set['emptyok'] = 0;
1024   $set['readonly'] = 1;
1025   $set['type'] = CONF_TYPE_DIR;
1026   $set['level'] = 4;
1027   $freepbx_conf->define_conf_setting('ASTAGIDIR',$set);
1028
1029   // ASTETCDIR
1030   $set['value'] = '/etc/asterisk';
1031   $set['options'] = '';
1032   $set['name'] = 'Asterisk etc Dir';
1033   $set['description'] = 'This is the default directory for Asterisks configuration files.';
1034   $set['emptyok'] = 0;
1035   $set['readonly'] = 1;
1036   $set['type'] = CONF_TYPE_DIR;
1037   $set['level'] = 4;
1038   $freepbx_conf->define_conf_setting('ASTETCDIR',$set);
1039
1040   // ASTLOGDIR
1041   $set['value'] = '/var/log/asterisk';
1042   $set['options'] = '';
1043   $set['name'] = 'Asterisk Log Dir';
1044   $set['description'] = 'This is the default directory for Asterisks log files.';
1045   $set['emptyok'] = 0;
1046   $set['readonly'] = 1;
1047   $set['type'] = CONF_TYPE_DIR;
1048   $set['level'] = 4;
1049   $freepbx_conf->define_conf_setting('ASTLOGDIR',$set);
1050
1051   // ASTMODDIR
1052   $set['value'] = '/usr/lib/asterisk/modules';
1053   $set['options'] = '';
1054   $set['name'] = 'Asterisk Modules Dir';
1055   $set['description'] = 'This is the default directory for Asterisks modules.';
1056   $set['emptyok'] = 0;
1057   $set['readonly'] = 1;
1058   $set['type'] = CONF_TYPE_DIR;
1059   $set['level'] = 4;
1060   $freepbx_conf->define_conf_setting('ASTMODDIR',$set);
1061
1062   // ASTSPOOLDIR
1063   $set['value'] = '/var/spool/asterisk';
1064   $set['options'] = '';
1065   $set['name'] = 'Asterisk Spool Dir';
1066   $set['description'] = 'This is the default directory for Asterisks spool directory.';
1067   $set['emptyok'] = 0;
1068   $set['readonly'] = 1;
1069   $set['type'] = CONF_TYPE_DIR;
1070   $set['level'] = 4;
1071   $freepbx_conf->define_conf_setting('ASTSPOOLDIR',$set);
1072
1073   // ASTRUNDIR
1074   $set['value'] = '/var/run/asterisk';
1075   $set['options'] = '';
1076   $set['name'] = 'Asterisk Run Dir';
1077   $set['description'] = 'This is the default directory for Asterisks run files.';
1078   $set['emptyok'] = 0;
1079   $set['readonly'] = 1;
1080   $set['type'] = CONF_TYPE_DIR;
1081   $set['level'] = 4;
1082   $freepbx_conf->define_conf_setting('ASTRUNDIR',$set);
1083
1084   // ASTVARLIBDIR
1085   $set['value'] = '/var/lib/asterisk';
1086   $set['options'] = '';
1087   $set['name'] = 'Asterisk bin Dir';
1088   $set['description'] = 'This is the default directory for Asterisks lib files.';
1089   $set['emptyok'] = 0;
1090   $set['readonly'] = 1;
1091   $set['type'] = CONF_TYPE_DIR;
1092   $set['level'] = 4;
1093   $freepbx_conf->define_conf_setting('ASTVARLIBDIR',$set);
1094
1095   // AMPCGIBIN
1096   $set['value'] = '/var/www/cgi-bin ';
1097   $set['options'] = '';
1098   $set['name'] = 'CGI Dir';
1099   $set['description'] = 'The path to Apache cgi-bin dir (leave off trailing slash).';
1100   $set['emptyok'] = 0;
1101   $set['readonly'] = 1;
1102   $set['type'] = CONF_TYPE_DIR;
1103   $set['level'] = 4;
1104   $freepbx_conf->define_conf_setting('AMPCGIBIN',$set);
1105
1106   // MOHDIR
1107   $set['value'] = 'moh';
1108   $set['options'] = array('moh','mohmp3');
1109   $set['name'] = 'MoH Subdirectory';
1110   $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.';
1111   $set['emptyok'] = 0;
1112   $set['readonly'] = 1;
1113   $set['type'] = CONF_TYPE_SELECT;
1114   $set['level'] = 4;
1115   $freepbx_conf->define_conf_setting('MOHDIR',$set);
1116   $set['level'] = 0;
1117
1118
1119   //
1120   // CATEGORY: GUI Behavior
1121   //
1122   $set['category'] = 'GUI Behavior';
1123
1124   // CHECKREFERER
1125   $set['value'] = true;
1126   $set['options'] = '';
1127   $set['name'] = 'Check Server Referrer';
1128   $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.';
1129   $set['emptyok'] = 0;
1130   $set['readonly'] = 0;
1131   $set['type'] = CONF_TYPE_BOOL;
1132   $freepbx_conf->define_conf_setting('CHECKREFERER',$set);
1133
1134   // MODULEADMINWGET
1135   $set['value'] = false;
1136   $set['options'] = '';
1137   $set['name'] = 'Use wget For Module Admin';
1138   $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.';
1139   $set['emptyok'] = 0;
1140   $set['readonly'] = 0;
1141   $set['type'] = CONF_TYPE_BOOL;
1142   $freepbx_conf->define_conf_setting('MODULEADMINWGET',$set);
1143
1144   // USECATEGORIES
1145   $set['value'] = true;
1146   $set['options'] = '';
1147   $set['name'] = 'Show Categories in Nav Menu';
1148   $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';
1149   $set['emptyok'] = 0;
1150   $set['readonly'] = 0;
1151   $set['type'] = CONF_TYPE_BOOL;
1152   $freepbx_conf->define_conf_setting('USECATEGORIES',$set);
1153
1154   // SERVERINTITLE
1155   $set['value'] = false;
1156   $set['options'] = '';
1157   $set['name'] = 'Include Server Name in Browser';
1158   $set['description'] = 'Precede browser title with the server name.';
1159   $set['emptyok'] = 0;
1160   $set['readonly'] = 0;
1161   $set['type'] = CONF_TYPE_BOOL;
1162   $freepbx_conf->define_conf_setting('SERVERINTITLE',$set);
1163
1164   // RELOADCONFIRM
1165   $set['value'] = true;
1166   $set['options'] = '';
1167   $set['name'] = 'Require Confirm with Apply Changes';
1168   $set['description'] = 'When set to false, will bypass the confirm on Reload Box.';
1169   $set['emptyok'] = 0;
1170   $set['readonly'] = 0;
1171   $set['type'] = CONF_TYPE_BOOL;
1172   $freepbx_conf->define_conf_setting('RELOADCONFIRM',$set);
1173
1174   // BADDESTABORT
1175   $set['value'] = false;
1176   $set['options'] = '';
1177   $set['name'] = 'Abort Config Gen on Bad Dest';
1178   $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.';
1179   $set['emptyok'] = 0;
1180   $set['level'] = 3;
1181   $set['readonly'] = 0;
1182   $set['type'] = CONF_TYPE_BOOL;
1183   $freepbx_conf->define_conf_setting('BADDESTABORT',$set);
1184   $set['level'] = 0;
1185
1186   // XTNCONFLICTABORT
1187   $set['value'] = false;
1188   $set['options'] = '';
1189   $set['name'] = 'Abort Config Gen on Exten Conflict';
1190   $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.';
1191   $set['emptyok'] = 0;
1192   $set['level'] = 3;
1193   $set['readonly'] = 0;
1194   $set['type'] = CONF_TYPE_BOOL;
1195   $freepbx_conf->define_conf_setting('XTNCONFLICTABORT',$set);
1196   $set['level'] = 0;
1197
1198   // CUSTOMASERROR
1199   $set['value'] = true;
1200   $set['options'] = '';
1201   $set['name'] = 'Report Unknown Dest as Error';
1202   $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.';
1203   $set['emptyok'] = 0;
1204   $set['level'] = 2;
1205   $set['readonly'] = 0;
1206   $set['type'] = CONF_TYPE_BOOL;
1207   $freepbx_conf->define_conf_setting('CUSTOMASERROR',$set);
1208   $set['level'] = 0;
1209
1210 // ALWAYS_SHOW_DEVICE_DETAILS
1211   $set['value'] = false;
1212   $set['options'] = '';
1213   $set['name'] = 'Show all Device Setting on Add';
1214   $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.';
1215   $set['emptyok'] = 0;
1216   $set['level'] = 0;
1217   $set['readonly'] = 0;
1218   $set['type'] = CONF_TYPE_BOOL;
1219   $freepbx_conf->define_conf_setting('ALWAYS_SHOW_DEVICE_DETAILS',$set);
1220   $set['level'] = 0;
1221
1222   //
1223   // CATEGORY: Asterisk Manager
1224   //
1225   $set['category'] = 'Asterisk Manager';
1226
1227   // AMPMGRPASS
1228   $set['value'] = 'amp111';
1229   $set['options'] = '';
1230   $set['name'] = 'Asterisk Manager Password';
1231   $set['description'] = 'Password for accessing the Asterisk Manager Interface (AMI), you must change this in manager.conf if changed here.';
1232   $set['emptyok'] = 0;
1233   $set['type'] = CONF_TYPE_TEXT;
1234   $set['level'] = 2;
1235   $set['readonly'] = 1;
1236   $freepbx_conf->define_conf_setting('AMPMGRPASS',$set);
1237   $set['level'] = 0;
1238
1239   // AMPMGRUSER
1240   $set['value'] = 'admin';
1241   $set['options'] = '';
1242   $set['name'] = 'Asterisk Manager User';
1243   $set['description'] = 'Username for accessing the Asterisk Manager Interface (AMI), you must change this in manager.conf if changed here.';
1244   $set['emptyok'] = 0;
1245   $set['readonly'] = 1;
1246   $set['type'] = CONF_TYPE_TEXT;
1247   $set['level'] = 2;
1248   $freepbx_conf->define_conf_setting('AMPMGRUSER',$set);
1249   $set['level'] = 0;
1250
1251   // ASTMANAGERHOST
1252   $set['value'] = 'localhost';
1253   $set['options'] = '';
1254   $set['name'] = 'Asterisk Manager Host';
1255   $set['description'] = 'Hostname for the Asterisk Manager';
1256   $set['emptyok'] = 0;
1257   $set['readonly'] = 1;
1258   $set['type'] = CONF_TYPE_TEXT;
1259   $set['level'] = 2;
1260   $freepbx_conf->define_conf_setting('ASTMANAGERHOST',$set);
1261   $set['level'] = 0;
1262
1263   // ASTMANAGERPORT
1264   $set['value'] = '5038';
1265   $set['name'] = 'Asterisk Manager Port';
1266   $set['description'] = 'Port for the Asterisk Manager';
1267   $set['emptyok'] = 0;
1268   $set['readonly'] = 1;
1269   $set['type'] = CONF_TYPE_INT;
1270   $set['options'] = array(1024,65535);
1271   $set['level'] = 2;
1272   $freepbx_conf->define_conf_setting('ASTMANAGERPORT',$set);
1273   $set['level'] = 0;
1274
1275   // ASTMANAGERPROXYPORT
1276   $set['value'] = '';
1277   $set['name'] = 'Asterisk Manager Proxy Port';
1278   $set['description'] = 'Optional port for an Asterisk Manager Proxy';
1279   $set['readonly'] = 1;
1280   $set['type'] = CONF_TYPE_INT;
1281   $set['emptyok'] = 1;
1282   $set['options'] = array(1024,65535);
1283   $set['level'] = 2;
1284   $freepbx_conf->define_conf_setting('ASTMANAGERPROXYPORT',$set);
1285   $set['level'] = 0;
1286
1287
1288   //
1289   // CATEGORY: Developer and Customization
1290   //
1291   $set['category'] = 'Developer and Customization';
1292   $set['level'] = 2;
1293
1294   // FPBXDBUGFILE
1295   $set['value'] = '/tmp/freepbx_debug.log';
1296   $set['options'] = '';
1297   $set['name'] = 'Debug File';
1298   $set['description'] = 'Full path and name of FreePBX debug file. Used by the dbug() function by developers.';
1299   $set['emptyok'] = 0;
1300   $set['readonly'] = 0;
1301   $set['type'] = CONF_TYPE_TEXT;
1302   $freepbx_conf->define_conf_setting('FPBXDBUGFILE',$set);
1303
1304   // FPBXDBUGDISABLE
1305   $set['value'] = true;
1306   $set['options'] = '';
1307   $set['name'] = 'Disable FreePBX dbug Logging';
1308   $set['description'] = 'Set to true to stop all dbug() calls from writing to the Debug File (FPBXDBUGFILE)';
1309   $set['emptyok'] = 0;
1310   $set['readonly'] = 0;
1311   $set['type'] = CONF_TYPE_BOOL;
1312   $freepbx_conf->define_conf_setting('FPBXDBUGDISABLE',$set);
1313
1314   // DIE_FREEPBX_VERBOSE
1315   $set['value'] = false;
1316   $set['options'] = '';
1317   $set['name'] = 'Provide Verbose Tracebacks';
1318   $set['description'] = 'Provides a very verbose traceback when die_freepbx() is called including extensive object details if present in the traceback.';
1319   $set['emptyok'] = 0;
1320   $set['readonly'] = 0;
1321   $set['type'] = CONF_TYPE_BOOL;
1322   $freepbx_conf->define_conf_setting('DIE_FREEPBX_VERBOSE',$set);
1323
1324
1325
1326   // DEVEL
1327   $set['value'] = false;
1328   $set['options'] = '';
1329   $set['name'] = 'Developer Mode';
1330   $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.';
1331   $set['emptyok'] = 0;
1332   $set['readonly'] = 0;
1333   $set['type'] = CONF_TYPE_BOOL;
1334   $freepbx_conf->define_conf_setting('DEVEL',$set);
1335
1336   // USE_PACKAGED_JS
1337   $set['value'] = true;
1338   $set['options'] = '';
1339   $set['name'] = 'Use Packaged Javascript Library ';
1340   $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.';
1341   $set['emptyok'] = 0;
1342   $set['readonly'] = 0;
1343   $set['type'] = CONF_TYPE_BOOL;
1344   $freepbx_conf->define_conf_setting('USE_PACKAGED_JS',$set);
1345
1346   // FORCE_JS_CSS_IMG_DOWNLOAD
1347   $set['value'] = false;
1348   $set['options'] = '';
1349   $set['name'] = 'Always Download Web Assets';
1350   $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.';
1351   $set['emptyok'] = 0;
1352   $set['readonly'] = 0;
1353   $set['type'] = CONF_TYPE_BOOL;
1354   $freepbx_conf->define_conf_setting('FORCE_JS_CSS_IMG_DOWNLOAD',$set);
1355
1356   // DEVELRELOAD
1357   $set['value'] = false;
1358   $set['options'] = '';
1359   $set['name'] = 'Leave Reload Bar Up';
1360   $set['description'] = "Forces the 'Apply Configuration Changes' reload bar to always be present even when not necessary.";
1361   $set['emptyok'] = 0;
1362   $set['readonly'] = 0;
1363   $set['type'] = CONF_TYPE_BOOL;
1364   $freepbx_conf->define_conf_setting('DEVELRELOAD',$set);
1365
1366   // PRE_RELOAD
1367   $set['value'] = '';
1368   $set['options'] = '';
1369   $set['name'] = 'PRE_RELOAD Script';
1370   $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.';
1371   $set['emptyok'] = 1;
1372   $set['readonly'] = 1;
1373   $set['type'] = CONF_TYPE_TEXT;
1374   $freepbx_conf->define_conf_setting('PRE_RELOAD',$set);
1375
1376   // POST_RELOAD
1377   $set['value'] = '';
1378   $set['options'] = '';
1379   $set['name'] = 'POST_RELOAD Script';
1380   $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.';
1381   $set['emptyok'] = 1;
1382   $set['readonly'] = 1;
1383   $set['type'] = CONF_TYPE_TEXT;
1384   $freepbx_conf->define_conf_setting('POST_RELOAD',$set);
1385
1386   // POST_RELOAD_DEBUG
1387   $set['value'] = false;
1388   $set['options'] = '';
1389   $set['name'] = 'POST_RELOAD Debug Mode';
1390   $set['description'] = 'Display debug output for script used if POST_RELOAD is used.';
1391   $set['emptyok'] = 0;
1392   $set['readonly'] = 0;
1393   $set['type'] = CONF_TYPE_BOOL;
1394   $freepbx_conf->define_conf_setting('POST_RELOAD_DEBUG',$set);
1395
1396   // AMPLOCALBIN
1397   $set['value'] = '';
1398   $set['options'] = '';
1399   $set['name'] = 'AMPLOCALBIN Dir for retrieve_conf';
1400   $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.';
1401   $set['emptyok'] = 1;
1402   $set['readonly'] = 1;
1403   $set['type'] = CONF_TYPE_DIR;
1404   $freepbx_conf->define_conf_setting('AMPLOCALBIN',$set);
1405  
1406   // DISABLE_CSS_AUTOGEN
1407   $set['value'] = false;
1408   $set['options'] = '';
1409   $set['name'] = 'Disable Mainstyle CSS Compression';
1410   $set['description'] = 'Stops the automatic generation of a stripped CSS file that replaces the primary sheet, usually mainstyle.css.';
1411   $set['emptyok'] = 0;
1412   $set['readonly'] = 0;
1413   $set['type'] = CONF_TYPE_BOOL;
1414   $freepbx_conf->define_conf_setting('DISABLE_CSS_AUTOGEN',$set);
1415
1416   // MODULEADMIN_SKIP_CACHE
1417   $set['value'] = false;
1418   $set['options'] = '';
1419   $set['name'] = 'Disable Module Admin Caching';
1420   $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.';
1421   $set['emptyok'] = 0;
1422   $set['readonly'] = 1;
1423   $set['type'] = CONF_TYPE_BOOL;
1424   $freepbx_conf->define_conf_setting('MODULEADMIN_SKIP_CACHE',$set);
1425
1426
1427   //
1428   // CATEGORY: Flash Operator Panel
1429   //
1430   $set['category'] = 'Flash Operator Panel';
1431   $set['level'] = 0;
1432
1433   // FOPSORT
1434   $set['value'] = 'extension';
1435   $set['options'] = 'extension,lastname';
1436   $set['name'] = 'FOP Sort Mode';
1437   $set['description'] = 'How FOP sort extensions. By Last Name [lastname] or by Extension [extension].';
1438   $set['emptyok'] = 0;
1439   $set['readonly'] = 0;
1440   $set['type'] = CONF_TYPE_SELECT;
1441   $freepbx_conf->define_conf_setting('FOPSORT',$set);
1442
1443   // FOPWEBROOT
1444   $set['value'] = '/var/www/html/panel';
1445   $set['options'] = '';
1446   $set['name'] = 'FOP Web Root Dir';
1447   $set['description'] = 'Path to the Flash Operator Panel webroot (leave off trailing slash).';
1448   $set['emptyok'] = 0;
1449   $set['readonly'] = 1;
1450   $set['type'] = CONF_TYPE_DIR;
1451   $set['level'] = 4;
1452   $freepbx_conf->define_conf_setting('FOPWEBROOT',$set);
1453   $set['level'] = 0;
1454
1455   // FOPPASSWORD
1456   $set['value'] = 'passw0rd';
1457   $set['options'] = '';
1458   $set['name'] = 'FOP Password';
1459   $set['description'] = 'Password for performing transfers and hangups in the Flash Operator Panel (FOP).';
1460   $set['emptyok'] = 0;
1461   $set['readonly'] = 0;
1462   $set['type'] = CONF_TYPE_TEXT;
1463   $freepbx_conf->define_conf_setting('FOPPASSWORD',$set);
1464
1465   // FOPDISABLE
1466   $set['value'] = false;
1467   $set['options'] = '';
1468   $set['name'] = 'Disable FOP';
1469   $set['description'] = 'Set to true to disable FOP in interface and retrieve_conf.  Useful for sqlite3 or if you do not want FOP.';
1470   $set['emptyok'] = 0;
1471   $set['readonly'] = 0;
1472   $set['type'] = CONF_TYPE_BOOL;
1473   $freepbx_conf->define_conf_setting('FOPDISABLE',$set);
1474
1475   // FOPRUN
1476   $set['value'] = true;
1477   $set['options'] = '';
1478   $set['name'] = 'Start FOP with amportal';
1479   $set['description'] = 'Set to true if you want FOP started by freepbx_engine (amportal_start), false otherwise.';
1480   $set['emptyok'] = 0;
1481   $set['readonly'] = 0;
1482   $set['type'] = CONF_TYPE_BOOL;
1483   $freepbx_conf->define_conf_setting('FOPRUN',$set);
1484
1485
1486   //
1487   // CATEGORY: Remote CDR Database
1488   //
1489   $set['category'] = 'Remote CDR Database';
1490   $set['level'] = 3;
1491
1492   // CDRDBHOST
1493   $set['value'] = '';
1494   $set['options'] = '';
1495   $set['name'] = 'Remote CDR DB Host';
1496   $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.';
1497   $set['emptyok'] = 1;
1498   $set['readonly'] = 1;
1499   $set['type'] = CONF_TYPE_TEXT;
1500   $freepbx_conf->define_conf_setting('CDRDBHOST',$set);
1501
1502   // CDRDBNAME
1503   $set['value'] = '';
1504   $set['options'] = '';
1505   $set['name'] = 'Remote CDR DB Name';
1506   $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.';
1507   $set['emptyok'] = 1;
1508   $set['readonly'] = 1;
1509   $set['type'] = CONF_TYPE_TEXT;
1510   $freepbx_conf->define_conf_setting('CDRDBNAME',$set);
1511
1512   // CDRDBPASS
1513   $set['value'] = '';
1514   $set['options'] = '';
1515   $set['name'] = 'Remote CDR DB Password';
1516   $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.';
1517   $set['emptyok'] = 1;
1518   $set['readonly'] = 1;
1519   $set['type'] = CONF_TYPE_TEXT;
1520   $freepbx_conf->define_conf_setting('CDRDBPASS',$set);
1521
1522   // CDRDBPORT
1523   $set['value'] = '';
1524   $set['options'] = array(1024,65536);
1525   $set['name'] = 'Remote CDR DB Port';
1526   $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.';
1527   $set['emptyok'] = 1;
1528   $set['readonly'] = 1;
1529   $set['type'] = CONF_TYPE_INT;
1530   $freepbx_conf->define_conf_setting('CDRDBPORT',$set);
1531
1532   // CDRDBTABLENAME
1533   $set['value'] = '';
1534   $set['options'] = '';
1535   $set['name'] = 'Remote CDR DB Table';
1536   $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.';
1537   $set['emptyok'] = 1;
1538   $set['readonly'] = 1;
1539   $set['type'] = CONF_TYPE_TEXT;
1540   $freepbx_conf->define_conf_setting('CDRDBTABLENAME',$set);
1541
1542   // CDRDBTYPE
1543   $set['value'] = '';
1544   $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.';
1545   $set['name'] = 'Remote CDR DB Type';
1546   $set['emptyok'] = 1;
1547   $set['options'] = ',mysql,postgres';
1548   $set['readonly'] = 1;
1549   $set['type'] = CONF_TYPE_SELECT;
1550   $freepbx_conf->define_conf_setting('CDRDBTYPE',$set);
1551
1552   // CDRDBUSER
1553   $set['value'] = '';
1554   $set['options'] = '';
1555   $set['name'] = 'Remote CDR DB User';
1556   $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.';
1557   $set['emptyok'] = 1;
1558   $set['readonly'] = 1;
1559   $set['type'] = CONF_TYPE_TEXT;
1560   $freepbx_conf->define_conf_setting('CDRDBUSER',$set);
1561
1562
1563   //
1564   // CATEGORY: Styling and Logos
1565   //
1566   $set['category'] = 'Styling and Logos';
1567   $set['level'] = 1;
1568
1569   // AMPADMINLOGO
1570   $set['value'] = '';
1571   $set['options'] = '';
1572   $set['name'] = 'Legacy Right Logo';
1573   $set['description'] = 'Legacy setting, use BRAND_IMAGE_FREEPBX_RIGHT in the future. If set, this will override BRAND_IMAGE_FREEPBX_RIGHT. The setting is the name of the image file and is always assumed to be present in the admin/images directory. Overrides the standard logo that is to be displayed at the TOP RIGHT of the admin screen. This enables you to customize the look of the administration screen. NOTE: images need to be saved in the ..../admin/images directory of your AMP install. This image should be 55px in height.';
1574   $set['readonly'] = 1;
1575   $set['sortorder'] = 0;
1576   $set['type'] = CONF_TYPE_TEXT;
1577   $set['emptyok'] = 1;
1578   $freepbx_conf->define_conf_setting('AMPADMINLOGO',$set);
1579
1580   // BRAND_IMAGE_HIDE_NAV_BACKGROUND
1581   $set['value'] = false;
1582   $set['options'] = '';
1583   $set['name'] = 'Hide Nav Background';
1584   $set['description'] = 'Hide the configured left navigation bar background.';
1585   $set['readonly'] = 0;
1586   $set['sortorder'] = 10;
1587   $set['type'] = CONF_TYPE_BOOL;
1588   $set['emptyok'] = 0;
1589   $freepbx_conf->define_conf_setting('BRAND_IMAGE_HIDE_NAV_BACKGROUND',$set);
1590
1591   // BRAND_IMAGE_SHADOW_SIDE_BACKGROUND
1592   $set['value'] = 'images/shadow-side-background.png';
1593   $set['options'] = '';
1594   $set['name'] = 'Image: shadow-side-background.png';
1595   $set['description'] = 'Styling image.';
1596   $set['emptyok'] = 1;
1597   $set['readonly'] = 1;
1598   $set['sortorder'] = 20;
1599   $set['type'] = CONF_TYPE_TEXT;
1600   $freepbx_conf->define_conf_setting('BRAND_IMAGE_SHADOW_SIDE_BACKGROUND',$set);
1601
1602   // BRAND_IMAGE_FREEPBX_RIGHT
1603   $set['value'] = 'images/logo.png';
1604   $set['options'] = '';
1605   $set['name'] = 'Image: Right Upper';
1606   $set['description'] = 'Right upper logo. Use this setting instead of AMPADMINLOGO. Path is relative to admin.';
1607   $set['readonly'] = 1;
1608   $set['sortorder'] = 30;
1609   $set['type'] = CONF_TYPE_TEXT;
1610   $set['emptyok'] = 0;
1611   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_RIGHT',$set);
1612
1613   // BRAND_IMAGE_FREEPBX_LEFT
1614   $set['value'] = 'images/freepbx_large.png';
1615   $set['options'] = '';
1616   $set['name'] = 'Image: Left Upper';
1617   $set['description'] = 'Left upper logo.  Path is relative to admin.';
1618   $set['readonly'] = 1;
1619   $set['sortorder'] = 40;
1620   $set['type'] = CONF_TYPE_TEXT;
1621   $set['emptyok'] = 0;
1622   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_LEFT',$set);
1623
1624   // BRAND_IMAGE_FREEPBX_FOOT
1625   $set['value'] = 'images/freepbx_small.png';
1626   $set['options'] = '';
1627   $set['name'] = 'Image: Footer';
1628   $set['description'] = 'Logo in footer.  Path is relative to admin.';
1629   $set['readonly'] = 1;
1630   $set['sortorder'] = 50;
1631   $set['type'] = CONF_TYPE_TEXT;
1632   $set['emptyok'] = 1;
1633   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_FOOT',$set);
1634
1635   // BRAND_IMAGE_RELOAD_LOADING
1636   $set['value'] = 'images/loading.gif';
1637   $set['options'] = '';
1638   $set['name'] = 'Image: Reload Screen';
1639   $set['description'] = 'Image used during a reload, default is animated GIF eating the * (asterisk).  Path is relative to admin.';
1640   $set['readonly'] = 1;
1641   $set['sortorder'] = 60;
1642   $set['type'] = CONF_TYPE_TEXT;
1643   $set['emptyok'] = 1;
1644   $freepbx_conf->define_conf_setting('BRAND_IMAGE_RELOAD_LOADING',$set);
1645
1646   // BRAND_FREEPBX_ALT_LEFT
1647   $set['value'] = '';
1648   $set['options'] = '';
1649   $set['name'] = 'Alt for Left Logo';
1650   $set['description'] = 'alt attribute to use in place of image and title hover value. Defaults to FreePBX';
1651   $set['readonly'] = 1;
1652   $set['sortorder'] = 70;
1653   $set['type'] = CONF_TYPE_TEXT;
1654   $set['emptyok'] = 1;
1655   $freepbx_conf->define_conf_setting('BRAND_FREEPBX_ALT_LEFT',$set);
1656
1657   // BRAND_FREEPBX_ALT_RIGHT
1658   $set['value'] = '';
1659   $set['options'] = '';
1660   $set['name'] = 'Alt for Right Logo';
1661   $set['description'] = 'alt attribute to use in place of image and title hover value. Defaults to FreePBX';
1662   $set['readonly'] = 1;
1663   $set['sortorder'] = 80;
1664   $set['type'] = CONF_TYPE_TEXT;
1665   $set['emptyok'] = 1;
1666   $freepbx_conf->define_conf_setting('BRAND_FREEPBX_ALT_RIGHT',$set);
1667
1668   // BRAND_FREEPBX_ALT_FOOT
1669   $set['value'] = '';
1670   $set['options'] = '';
1671   $set['name'] = 'Alt for Footer Logo';
1672   $set['description'] = 'alt attribute to use in place of image and title hover value. Defaults to FreePBX';
1673   $set['readonly'] = 1;
1674   $set['sortorder'] = 90;
1675   $set['type'] = CONF_TYPE_TEXT;
1676   $set['emptyok'] = 1;
1677   $freepbx_conf->define_conf_setting('BRAND_FREEPBX_ALT_FOOT',$set);
1678
1679   // BRAND_IMAGE_FREEPBX_LINK_LEFT
1680   $set['value'] = '';
1681   $set['options'] = '';
1682   $set['name'] = 'Link for Left Logo';
1683   $set['description'] = 'link to follow when clicking on logo, defaults to http://www.freepbx.org';
1684   $set['readonly'] = 1;
1685   $set['sortorder'] = 100;
1686   $set['type'] = CONF_TYPE_TEXT;
1687   $set['emptyok'] = 1;
1688   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_LINK_LEFT',$set);
1689
1690   // BRAND_IMAGE_FREEPBX_LINK_RIGHT
1691   $set['value'] = '';
1692   $set['options'] = '';
1693   $set['name'] = 'Link for Right Logo';
1694   $set['description'] = 'link to follow when clicking on logo, defaults to http://www.freepbx.org';
1695   $set['readonly'] = 1;
1696   $set['sortorder'] = 110;
1697   $set['type'] = CONF_TYPE_TEXT;
1698   $set['emptyok'] = 1;
1699   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_LINK_RIGHT',$set);
1700
1701   // BRAND_IMAGE_FREEPBX_LINK_FOOT
1702   $set['value'] = '';
1703   $set['options'] = '';
1704   $set['name'] = 'Link for Footer Logo';
1705   $set['description'] = 'link to follow when clicking on logo, defaults to http://www.freepbx.org';
1706   $set['readonly'] = 1;
1707   $set['sortorder'] = 120;
1708   $set['type'] = CONF_TYPE_TEXT;
1709   $set['emptyok'] = 1;
1710   $freepbx_conf->define_conf_setting('BRAND_IMAGE_FREEPBX_LINK_FOOT',$set);
1711
1712   // BRAND_HIDE_LOGO_RIGHT
1713   $set['value'] = false;
1714   $set['options'] = '';
1715   $set['name'] = 'Hide Right Logo';
1716   $set['description'] = 'Setting to true will hide the upper right logo.';
1717   $set['readonly'] = 0;
1718   $set['sortorder'] = 130;
1719   $set['type'] = CONF_TYPE_BOOL;
1720   $set['emptyok'] = 0;
1721   $freepbx_conf->define_conf_setting('BRAND_HIDE_LOGO_RIGHT',$set);
1722
1723   // BRAND_HIDE_HEADER_VERSION
1724   $set['value'] = false;
1725   $set['options'] = '';
1726   $set['name'] = 'Hide Left FreePBX Version';
1727   $set['description'] = 'Setting to true will hide the FreePBX version information below the left upper header.';
1728   $set['readonly'] = 0;
1729   $set['sortorder'] = 140;
1730   $set['type'] = CONF_TYPE_BOOL;
1731   $set['emptyok'] = 0;
1732   $freepbx_conf->define_conf_setting('BRAND_HIDE_HEADER_VERSION',$set);
1733
1734   // BRAND_HIDE_HEADER_MENUS
1735   $set['value'] = false;
1736   $set['options'] = '';
1737   $set['name'] = 'Hide Header Menus';
1738   $set['description'] = 'Setting to true will hide the complete horizontal menu bar in the header.';
1739   $set['readonly'] = 0;
1740   $set['sortorder'] = 150;
1741   $set['type'] = CONF_TYPE_BOOL;
1742   $set['emptyok'] = 0;
1743   $freepbx_conf->define_conf_setting('BRAND_HIDE_HEADER_MENUS',$set);
1744
1745   // BRAND_CSS_ALT_MAINSTYLE
1746   $set['value'] = '';
1747   $set['options'] = '';
1748   $set['name'] = 'Primary CSS Stylesheet';
1749   $set['description'] = 'Set this to replace the default mainstyle.css style sheet with your own, relative to admin.';
1750   $set['readonly'] = 1;
1751   $set['sortorder'] = 160;
1752   $set['type'] = CONF_TYPE_TEXT;
1753   $set['emptyok'] = 1;
1754   $freepbx_conf->define_conf_setting('BRAND_CSS_ALT_MAINSTYLE',$set);
1755
1756   // BRAND_CSS_CUSTOM
1757   $set['value'] = '';
1758   $set['options'] = '';
1759   $set['name'] = 'Optional Additional CSS Stylesheet';
1760   $set['description'] = 'Optional custom CSS style sheet included after the primary one and any module specific ones are loaded, relative to admin.';
1761   $set['readonly'] = 1;
1762   $set['sortorder'] = 170;
1763   $set['type'] = CONF_TYPE_TEXT;
1764   $set['emptyok'] = 1;
1765   $freepbx_conf->define_conf_setting('BRAND_CSS_CUSTOM',$set);
1766
1767   // VIEW_FREEPBX_ADMIN
1768   $set['value'] = 'views/freepbx_admin.php';
1769   $set['options'] = '';
1770   $set['name'] = 'View: freepbx_admin.php';
1771   $set['description'] = 'freepbx_admin.php view. This should never be changed except for very advanced layout changes.';
1772   $set['readonly'] = 1;
1773   $set['emptyok'] = 0;
1774   $set['hidden'] = 1;
1775   $set['sortorder'] = 180;
1776   $set['type'] = CONF_TYPE_TEXT;
1777   $freepbx_conf->define_conf_setting('VIEW_FREEPBX_ADMIN',$set);
1778   $set['hidden'] = 0;
1779
1780   // VIEW_FREEPBX
1781   $set['value'] = 'views/freepbx.php';
1782   $set['options'] = '';
1783   $set['name'] = 'View: freepbx.php';
1784   $set['description'] = 'freepbx.php view. This should never be changed except for very advanced layout changes.';
1785   $set['readonly'] = 1;
1786   $set['emptyok'] = 0;
1787   $set['hidden'] = 1;
1788   $set['sortorder'] = 190;
1789   $set['type'] = CONF_TYPE_TEXT;
1790   $freepbx_conf->define_conf_setting('VIEW_FREEPBX',$set);
1791   $set['hidden'] = 0;
1792
1793   // VIEW_FREEPBX_RELOAD
1794   $set['value'] = 'views/freepbx_reload.php';
1795   $set['options'] = '';
1796   $set['name'] = 'View: freepbx_reload.php';
1797   $set['description'] = 'freepbx_reload.php view. This should never be changed except for very advanced layout changes.';
1798   $set['readonly'] = 1;
1799   $set['emptyok'] = 0;
1800   $set['hidden'] = 1;
1801   $set['sortorder'] = 200;
1802   $set['type'] = CONF_TYPE_TEXT;
1803   $freepbx_conf->define_conf_setting('VIEW_FREEPBX_RELOAD',$set);
1804   $set['hidden'] = 0;
1805
1806   // VIEW_FREEPBX_RELOADBAR
1807   $set['value'] = 'views/freepbx_reloadbar.php';
1808   $set['options'] = '';
1809   $set['name'] = 'View: freepbx_reloadbar.php';
1810   $set['description'] = 'freepbx_reloadbar.php view. This should never be changed except for very advanced layout changes.';
1811   $set['readonly'] = 1;
1812   $set['emptyok'] = 0;
1813   $set['hidden'] = 1;
1814   $set['sortorder'] = 210;
1815   $set['type'] = CONF_TYPE_TEXT;
1816   $freepbx_conf->define_conf_setting('VIEW_FREEPBX_RELOADBAR',$set);
1817   $set['hidden'] = 0;
1818
1819   // VIEW_WELCOME
1820   $set['value'] = 'views/welcome.php';
1821   $set['options'] = '';
1822   $set['name'] = 'View: welcome.php';
1823   $set['description'] = 'welcome.php view. This should never be changed except for very advanced layout changes.';
1824   $set['readonly'] = 1;
1825   $set['emptyok'] = 0;
1826   $set['hidden'] = 1;
1827   $set['sortorder'] = 220;
1828   $set['type'] = CONF_TYPE_TEXT;
1829   $freepbx_conf->define_conf_setting('VIEW_WELCOME',$set);
1830   $set['hidden'] = 0;
1831
1832   // VIEW_WELCOME_NONMANAGER
1833   $set['value'] = 'views/welcome_nomanager.php';
1834   $set['options'] = '';
1835   $set['name'] = 'View: welcome_nomanager.php';
1836   $set['description'] = 'welcome_nomanager.php view. This should never be changed except for very advanced layout changes.';
1837   $set['readonly'] = 1;
1838   $set['emptyok'] = 0;
1839   $set['hidden'] = 1;
1840   $set['sortorder'] = 230;
1841   $set['type'] = CONF_TYPE_TEXT;
1842   $freepbx_conf->define_conf_setting('VIEW_WELCOME_NONMANAGER',$set);
1843   $set['hidden'] = 0;
1844
1845   // VIEW_MENUITEM_DISABLED
1846   $set['value'] = 'views/menuitem_disabled.php';
1847   $set['options'] = '';
1848   $set['name'] = 'View: menuitem_disabled.php';
1849   $set['description'] = 'menuitem_disabled.php view. This should never be changed except for very advanced layout changes.';
1850   $set['readonly'] = 1;
1851   $set['emptyok'] = 0;
1852   $set['hidden'] = 1;
1853   $set['sortorder'] = 240;
1854   $set['type'] = CONF_TYPE_TEXT;
1855   $freepbx_conf->define_conf_setting('VIEW_MENUITEM_DISABLED',$set);
1856   $set['hidden'] = 0;
1857
1858   // VIEW_NOACCESS
1859   $set['value'] = 'views/noaccess.php';
1860   $set['options'] = '';
1861   $set['name'] = 'View: noaccess.php';
1862   $set['description'] = 'noaccess.php view. This should never be changed except for very advanced layout changes.';
1863   $set['readonly'] = 1;
1864   $set['emptyok'] = 0;
1865   $set['hidden'] = 1;
1866   $set['sortorder'] = 250;
1867   $set['type'] = CONF_TYPE_TEXT;
1868   $freepbx_conf->define_conf_setting('VIEW_NOACCESS',$set);
1869   $set['hidden'] = 0;
1870
1871   // VIEW_UNAUTHORIZED
1872   $set['value'] = 'views/unauthorized.php';
1873   $set['options'] = '';
1874   $set['name'] = 'View: unauthorized.php';
1875   $set['description'] = 'unauthorized.php view. This should never be changed except for very advanced layout changes.';
1876   $set['readonly'] = 1;
1877   $set['emptyok'] = 0;
1878   $set['hidden'] = 1;
1879   $set['sortorder'] = 260;
1880   $set['type'] = CONF_TYPE_TEXT;
1881   $freepbx_conf->define_conf_setting('VIEW_UNAUTHORIZED',$set);
1882   $set['hidden'] = 0;
1883
1884   // VIEW_BAD_REFFERER
1885   $set['value'] = 'views/bad_refferer.php';
1886   $set['options'] = '';
1887   $set['name'] = 'View: bad_refferer.php';
1888   $set['description'] = 'bad_refferer.php view. This should never be changed except for very advanced layout changes.';
1889   $set['readonly'] = 1;
1890   $set['emptyok'] = 0;
1891   $set['hidden'] = 1;
1892   $set['sortorder'] = 270;
1893   $set['type'] = CONF_TYPE_TEXT;
1894   $freepbx_conf->define_conf_setting('VIEW_BAD_REFFERER',$set);
1895   $set['hidden'] = 0;
1896
1897   // VIEW_LOGGEDOUT
1898   $set['value'] = 'views/loggedout.php';
1899   $set['options'] = '';
1900   $set['name'] = 'View: loggedout.php';
1901   $set['description'] = 'loggedout.php view. This should never be changed except for very advanced layout changes.';
1902   $set['readonly'] = 1;
1903   $set['emptyok'] = 0;
1904   $set['hidden'] = 1;
1905   $set['sortorder'] = 280;
1906   $set['type'] = CONF_TYPE_TEXT;
1907   $freepbx_conf->define_conf_setting('VIEW_LOGGEDOUT',$set);
1908   $set['hidden'] = 0;
1909
1910   // VIEW_PANEL
1911   $set['value'] = 'views/panel.php';
1912   $set['options'] = '';
1913   $set['name'] = 'View: panel.php';
1914   $set['description'] = 'panel.php view. This should never be changed except for very advanced layout changes.';
1915   $set['readonly'] = 1;
1916   $set['emptyok'] = 0;
1917   $set['hidden'] = 1;
1918   $set['sortorder'] = 290;
1919   $set['type'] = CONF_TYPE_TEXT;
1920   $freepbx_conf->define_conf_setting('VIEW_PANEL',$set);
1921   $set['hidden'] = 0;
1922
1923   // VIEW_REPORTS
1924   $set['value'] = 'views/reports.php';
1925   $set['options'] = '';
1926   $set['name'] = 'View: reports.php';
1927   $set['description'] = 'reports.php view. This should never be changed except for very advanced layout changes.';
1928   $set['readonly'] = 1;
1929   $set['emptyok'] = 0;
1930   $set['hidden'] = 1;
1931   $set['sortorder'] = 300;
1932   $set['type'] = CONF_TYPE_TEXT;
1933   $freepbx_conf->define_conf_setting('VIEW_REPORTS',$set);
1934   $set['hidden'] = 0;
1935
1936
1937   //
1938   // CATEGORY: Device Setting Defaults
1939   //
1940   $set['category'] = 'Device Settings';
1941   $set['level'] = 0;
1942
1943   // ALWAYS_SHOW_DEVICE_DETAILS
1944   $set['value'] = false;
1945   $set['options'] = '';
1946   $set['name'] = 'Show all Device Setting on Add';
1947   $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.';
1948   $set['readonly'] = 0;
1949   $set['type'] = CONF_TYPE_BOOL;
1950   $set['emptyok'] = 0;
1951   $set['sortorder'] = 10;
1952   $freepbx_conf->define_conf_setting('ALWAYS_SHOW_DEVICE_DETAILS',$set);
1953
1954   // DEVICE_STRONG_SECRETS
1955   $set['value'] = true;
1956   $set['options'] = '';
1957   $set['name'] = 'Require Strong Secrets';
1958   $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.';
1959   $set['readonly'] = 0;
1960   $set['type'] = CONF_TYPE_BOOL;
1961   $set['emptyok'] = 0;
1962   $set['sortorder'] = 12;
1963   $freepbx_conf->define_conf_setting('DEVICE_STRONG_SECRETS',$set);
1964
1965   // DEVICE_SIP_CANREINVITE
1966   $set['value'] = 'no';
1967   $set['options'] = array('no', 'yes', 'nonat', 'update');
1968   $set['name'] = 'SIP canrenivite (directmedia)';
1969   $set['description'] = 'Default setting for SIP canreinvite (same as directmedia). See Asterisk documentation for details.';
1970   $set['readonly'] = 0;
1971   $set['type'] = CONF_TYPE_SELECT;
1972   $set['emptyok'] = 0;
1973   $set['sortorder'] = 20;
1974   $freepbx_conf->define_conf_setting('DEVICE_SIP_CANREINVITE',$set);
1975
1976   // DEVICE_SIP_TRUSTRPID
1977   $set['value'] = 'yes';
1978   $set['options'] = array('no', 'yes');
1979   $set['name'] = 'SIP trustrpid';
1980   $set['description'] = 'Default setting for SIP trustrpid. See Asterisk documentation for details.';
1981   $set['readonly'] = 0;
1982   $set['type'] = CONF_TYPE_SELECT;
1983   $set['emptyok'] = 0;
1984   $set['sortorder'] = 30;
1985   $freepbx_conf->define_conf_setting('DEVICE_SIP_TRUSTRPID',$set);
1986
1987   // DEVICE_SIP_SENDRPID
1988   $set['value'] = 'no';
1989   $set['options'] = array('no', 'yes', 'pai');
1990   $set['name'] = 'SIP sendrpid';
1991   $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.";
1992   $set['readonly'] = 0;
1993   $set['type'] = CONF_TYPE_SELECT;
1994   $set['emptyok'] = 0;
1995   $set['sortorder'] = 40;
1996   $freepbx_conf->define_conf_setting('DEVICE_SIP_SENDRPID',$set);
1997
1998   // DEVICE_SIP_NAT
1999   $set['value'] = 'no';
2000   $set['options'] = array('no', 'yes', 'never', 'route');
2001   $set['name'] = 'SIP nat';
2002   $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.";
2003   $set['readonly'] = 0;
2004   $set['type'] = CONF_TYPE_SELECT;
2005   $set['emptyok'] = 0;
2006   $set['sortorder'] = 50;
2007   $freepbx_conf->define_conf_setting('DEVICE_SIP_NAT',$set);
2008
2009   // DEVICE_SIP_ENCRYPTION
2010   $set['value'] = 'no';
2011   $set['options'] = array('no', 'yes');
2012   $set['name'] = 'SIP encryption';
2013   $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.";
2014   $set['readonly'] = 0;
2015   $set['type'] = CONF_TYPE_SELECT;
2016   $set['emptyok'] = 0;
2017   $set['sortorder'] = 60;
2018   $freepbx_conf->define_conf_setting('DEVICE_SIP_ENCRYPTION',$set);
2019
2020   // DEVICE_SIP_QUALIFYFREQ
2021   $set['value'] = 60;
2022   $set['options'] = array(15, 86400);
2023   $set['name'] = 'SIP qualifyfreq';
2024   $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.";
2025   $set['readonly'] = 0;
2026   $set['type'] = CONF_TYPE_INT;
2027   $set['emptyok'] = 0;
2028   $set['sortorder'] = 70;
2029   $freepbx_conf->define_conf_setting('DEVICE_SIP_QUALIFYFREQ',$set);
2030
2031   // DEVICE_QUALIFY
2032   $set['value'] = 'yes';
2033   $set['options'] = '';
2034   $set['name'] = 'SIP and IAX qualify';
2035   $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.";
2036   $set['readonly'] = 0;
2037   $set['type'] = CONF_TYPE_TEXT;
2038   $set['emptyok'] = 0;
2039   $set['sortorder'] = 80;
2040   $freepbx_conf->define_conf_setting('DEVICE_QUALIFY',$set);
2041
2042   // DEVICE_DISALLOW
2043   $set['value'] = '';
2044   $set['options'] = '';
2045   $set['name'] = 'SIP and IAX disallow';
2046   $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.";
2047   $set['readonly'] = 0;
2048   $set['type'] = CONF_TYPE_TEXT;
2049   $set['emptyok'] = 1;
2050   $set['sortorder'] = 90;
2051   $freepbx_conf->define_conf_setting('DEVICE_DISALLOW',$set);
2052
2053   // DEVICE_ALLOW
2054   $set['value'] = '';
2055   $set['options'] = '';
2056   $set['name'] = 'SIP and IAX allow';
2057   $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.";
2058   $set['readonly'] = 0;
2059   $set['type'] = CONF_TYPE_TEXT;
2060   $set['emptyok'] = 1;
2061   $set['sortorder'] = 90;
2062   $freepbx_conf->define_conf_setting('DEVICE_ALLOW',$set);
2063
2064   // DEVICE_CALLGROUP
2065   $set['value'] = '';
2066   $set['options'] = '';
2067   $set['name'] = 'SIP and DAHDi callgroup';
2068   $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.";
2069   $set['readonly'] = 0;
2070   $set['type'] = CONF_TYPE_TEXT;
2071   $set['emptyok'] = 1;
2072   $set['sortorder'] = 100;
2073   $freepbx_conf->define_conf_setting('DEVICE_CALLGROUP',$set);
2074
2075   // DEVICE_PICKUPGROUP
2076   $set['value'] = '';
2077   $set['options'] = '';
2078   $set['name'] = 'SIP and DAHDi pickupgroup';
2079   $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.";
2080   $set['readonly'] = 0;
2081   $set['type'] = CONF_TYPE_TEXT;
2082   $set['emptyok'] = 1;
2083   $set['sortorder'] = 110;
2084   $freepbx_conf->define_conf_setting('DEVICE_PICKUPGROUP',$set);
2085
2086   // The following settings are used in various modules prior to 2.9. If they are found in amportal.conf then we
2087   // retain their values until the individual modules are updated and their install scripts run where a full
2088   // configuration (descriptions, defaults, etc.) will be provided and maintained. This provides just enough to
2089   // carry the setting through the migration since most upgrades will run framework or install_amp followed by the
2090   // module install scripts.
2091   //
2092   $module_migrate['AMPPLAYKEY'] = CONF_TYPE_TEXT;
2093   $module_migrate['AMPBACKUPEMAILFROM'] = CONF_TYPE_TEXT;
2094   $module_migrate['AMPBACKUPSUDO'] = CONF_TYPE_BOOL;
2095   $module_migrate['USEQUEUESTATE'] = CONF_TYPE_BOOL;
2096   $module_migrate['DASHBOARD_INFO_UPDATE_TIME'] = CONF_TYPE_INT;
2097   $module_migrate['DASHBOARD_STATS_UPDATE_TIME'] = CONF_TYPE_INT;
2098   $module_migrate['SSHPORT'] = CONF_TYPE_INT;
2099   $module_migrate['MAXCALLS'] = CONF_TYPE_INT;
2100   $module_migrate['AMPMPG123'] = CONF_TYPE_BOOL;
2101   $module_migrate['PARKINGPATCH'] = CONF_TYPE_BOOL;
2102
2103   $mod_set['value'] = '';
2104   $mod_set['defaultval'] = '';
2105   $mod_set['readonly'] = 0;
2106   $mod_set['hidden'] = 1;
2107   $mod_set['level'] = 10;
2108   $mod_set['module'] = '';
2109   $mod_set['category'] = 'Under Migration';
2110   $mod_set['emptyok'] = 1;
2111   $mod_set['description'] = 'This setting is being migrated and will be initialized by its module install script on upgrade.';
2112   foreach ($module_migrate as $setting => $type) {
2113     if (isset($amp_conf[$setting])  && !$freepbx_conf->conf_setting_exists($setting)) {
2114       $val = $amp_conf[$setting];
2115
2116       // since this came from a conf file, change any 'false' that will otherwise turn to true
2117       //
2118       if ($type == CONF_TYPE_BOOL) switch (strtolower($val)) {
2119       case 'false':
2120       case 'no':
2121       case 'off':
2122         $val = false;
2123       break;
2124       }
2125       $mod_set['value'] = $val;
2126       $mod_set['type'] = $type;
2127       $freepbx_conf->define_conf_setting($setting,$mod_set);
2128     }
2129   }
2130
2131   if ($commit_to_db) {
2132     $freepbx_conf->commit_conf_settings();
2133   }
2134 }
Note: See TracBrowser for help on using the browser.