Changeset 10719 for freepbx/trunk

Show
Ignore:
Timestamp:
12/19/10 00:51:33 (2 years ago)
Author:
p_lindheimer
Message:

get engine info before creating the conf file classes in case any of them actually depend on that info, and check for existance of func_shared()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/bin/retrieve_conf

    r10712 r10719  
    524524} 
    525525 
     526$engineinfo = engine_getinfo(); 
     527if($engineinfo['version'] == 0){ 
     528  freepbx_log('retrieve_conf', 'fatal', "Failed to get engine information (engine_getinfo: {$engineinfo['engine']})"); 
     529  fatal(_("Failed to get engine_info"),_("retreive_conf failed to get engine information and cannot configure up a softwitch with out it. Error: {$engineinfo['engine']}")); 
     530} 
     531// was setting these variables before, assume we still need them 
     532$engine = $engineinfo['engine']; 
     533$version = $engineinfo['version']; 
     534$chan_dahdi = ast_with_dahdi(); 
     535 
     536$has_func_shared = false; 
     537if (version_compare($version, '1.6', 'lt')) { 
     538  $response = $astman->send_request('Command', array('Command' => 'module show like func_shared')); 
     539  if (preg_match('/1 modules loaded/', $response['data'])) { 
     540    $has_func_shared = true; 
     541  } 
     542} else { 
     543  $has_func_shared = true; 
     544} 
     545 
    526546// create objects for any module classes 
    527547// currently only 1 class can be declared per module, not sure if that will be an issue 
     
    536556} 
    537557 
    538 $engineinfo = engine_getinfo(); 
    539 if($engineinfo['version'] == 0){ 
    540   freepbx_log('retrieve_conf', 'fatal', "Failed to get engine information (engine_getinfo: {$engineinfo['engine']})"); 
    541   fatal(_("Failed to get engine_info"),_("retreive_conf failed to get engine information and cannot configure up a softwitch with out it. Error: {$engineinfo['engine']}")); 
    542 } 
    543 // was setting these variables before, assume we still need them 
    544 $engine = $engineinfo['engine']; 
    545 $version = $engineinfo['version']; 
    546 $chan_dahdi = ast_with_dahdi(); 
    547558 
    548559// Check for and report any extension conflicts 
    549560// 
    550  
    551561$extens_ok = true; 
    552562$dests_ok = true;