Show
Ignore:
Timestamp:
12/29/06 00:24:26 (6 years ago)
Author:
qldrob
Message:

Start support for 'asterisk14' engine. I may end up taking this out.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/install_amp

    r3366 r3436  
    4848  ); 
    4949 
    50 define("REQ_ASTERISK_VERSION", "1.2"); 
    5150 
    5251/********************************************************************************************************************/ 
     
    9796  out("                           it's a new installation)"); 
    9897  out("  --my-svn-is-correct      Ignore Asterisk version, assume it is correct"); 
    99   out("  --engine <name>          Use the specified PBX Engine ('asterisk' or 'openpbx')"); 
     98  out("  --engine <name>          Use the specified PBX Engine ('asterisk', 'asterisk14' or 'openpbx')"); 
    10099} 
    101100 
     
    627626// **** Parse out command-line options 
    628627$shortopts = "h?u:p:"; 
    629 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine","install-moh"); 
     628$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine=","install-moh"); 
    630629 
    631630$args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); 
     
    691690    break; 
    692691    case "--engine": 
     692      if ($arg[1] != 'asterisk' && $arg[1] != 'asterisk14' && $arg[1] != 'openpbx') { 
     693        fatal('Currently only "asterisk", "asterisk14" or "openpbx" are supported as a PBX engine'); 
     694      } 
    693695      $pbx_engine = $arg[1]; 
    694       if ($pbx_engine != 'asterisk') { 
    695         fatal('Currently only "asterisk" is supported as a PBX engine'); 
    696       } 
    697696    break; 
    698697    case "--install-moh": 
     
    880879 
    881880// **** Check asterisk verison 
    882  
    883 outn("Checking for Asterisk ".REQ_ASTERISK_VERSION.".."); 
     881//  Set the 'engine' to be 'asterisk14' if using asterisk 1.4, otherwise 
     882//  'asterisk' 
     883outn("Checking for Asterisk version.."); 
    884884if (preg_match('/^Asterisk (\d+(\.\d+)*)(-?(.*))$/', $verinfo, $matches)) { 
    885   if (version_compare($matches[1], REQ_ASTERISK_VERSION) < 0) { 
    886     fatal("Asterisk ".REQ_ASTERISK_VERSION." is required for this version of freePBX"); 
    887   } 
     885  if (version_compare($matches[1], "1.2") < 0) { 
     886    fatal("At least Asterisk 1.2 is required for this version of freePBX"); 
     887  } 
     888  if (version_compare($matches[1], "1.4", "ge"))  
    888889  out("OK"); 
    889890} elseif (preg_match('/^Asterisk SVN.+/', $verinfo)) { 
     
    893894  out("that your Asterisk version is compatible with FreePBX. Whilst this probably"); 
    894895  out("won't cause any problems, YOU NEED TO BE CERTAIN that it is compatible"); 
    895   out("with at least the released Asterisk version ".REQ_ASTERISK_VERSION."." ); 
     896  out("with at least the released Asterisk version 1.2" ); 
    896897  if ($override_astvers==false) { 
    897898    out("If you are SURE that this is compatible, you can re-run ".$argv[0]." with");