Show
Ignore:
Timestamp:
11/30/11 19:54:50 (1 year ago)
Author:
p_lindheimer
Message:

auto-detect or correct ASTCONFAPP and notify if changes are made

Files:

Legend:

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

    r12932 r12983  
    550550$freepbx_conf->set_conf_values($update_arr, true, true); 
    551551 
     552$nt = notifications::create($db); 
     553 
     554$conf_change = _("Conference Room App Changed"); 
     555$conf_change_desc = _("Your Conference Room App (ASTCONFAPP) was automatically changed from %s to %s because %s is not installed on your Asterisk installation"); 
     556 
     557$conf_missing = _("No Conference Room App"); 
     558$conf_missing_desc = _("Neither app_meetme nor app_confbridge is configured in Asterisk, conferencing, paging and other functionality will not work properly"); 
     559 
     560if ($amp_conf['ASTCONFAPP'] == 'app_meetme' && !$astman->app_exists('meetme')) { 
     561  if ($astman->app_exists('confbridge')) { 
     562    $freepbx_conf->set_conf_values(array('ASTCONFAPP' => 'app_confbridge'), true, true); 
     563    $nt->add_notice('framework', 'ASTCONFAPPCHG', $conf_change, sprintf($conf_change_desc,'app_meetme','app_confbridge','app_meetme')); 
     564    $nt->delete('framework', 'ASTCONFAPPMISSING'); 
     565  } else { 
     566    $nt->add_error('framework', 'ASTCONFAPPMISSING', $conf_missing, $conf_missing_desc); 
     567  } 
     568} elseif ($amp_conf['ASTCONFAPP'] == 'app_confbridge' && !$astman->app_exists('confbridge')) { 
     569  if ($astman->app_exists('meetme')) { 
     570    $freepbx_conf->set_conf_values(array('ASTCONFAPP' => 'app_meetme'), true, true); 
     571    $nt->add_notice('framework', 'ASTCONFAPPCHG', $conf_change, sprintf($conf_change_desc,'app_confbridge','app_meetme','app_confbridge')); 
     572    $nt->delete('framework', 'ASTCONFAPPMISSING'); 
     573  } else { 
     574    $nt->add_error('framework', 'ASTCONFAPPMISSING', $conf_missing, $conf_missing_desc); 
     575  } 
     576} else { 
     577  $nt->delete('framework', 'ASTCONFAPPMISSING'); 
     578} 
     579 
    552580// Check for and report any extension conflicts 
    553581// 
     
    555583$extens_ok = true; 
    556584$dests_ok = true; 
    557  
    558 $nt = notifications::create($db); 
    559585 
    560586$my_hash = array_flip($module_list);