Changeset 7096 for modules/branches

Show
Ignore:
Timestamp:
10/22/08 08:08:48 (5 years ago)
Author:
mbrevda
Message:

closes #2940, make indications conf files more streamline with freepbx, dont generate country tones except the one being used, as asterisk cant do anything with them anyway

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.6/core/functions.inc.php

    r7095 r7096  
    42004200  $result = $db->getRow($sql,DB_FETCHMODE_ASSOC); 
    42014201 
    4202   $filenamedir = isset($asterisk_conf["astetcdir"]) && $asterisk_conf["astetcdir"] != '' ? rtrim($asterisk_conf["astetcdir"],DIRECTORY_SEPARATOR) : "/etc/asterisk"; 
    4203   $filename = $filenamedir."/indications_general_additional.conf"; 
     4202  $filename = isset($asterisk_conf["astetcdir"]) && $asterisk_conf["astetcdir"] != '' ? rtrim($asterisk_conf["astetcdir"],DIRECTORY_SEPARATOR) : "/etc/asterisk"; 
     4203  $filename .= "/indications.conf"; 
    42044204 
    42054205  if (($fd = fopen($filename, "w")) === false) { 
    42064206    $desc = sprintf(_("Failed to open %s for writing, aborting attempt to write the country indications. The file may be readonly or the permissions may be incorrect."), $filename); 
    4207     $notify->add_error('core','INDICATIONS',_("Failed to write indications_general_additional.conf"), $desc); 
     4207    $notify->add_error('core','INDICATIONS',_("Failed to write indications.conf"), $desc); 
    42084208    return; 
    42094209  } 
    42104210  $notify->delete('core', 'INDICATIONS'); 
    42114211 
    4212   fwrite($fd, "country=".$result['value']."\n\n"); 
    4213   fclose($fd); 
    4214  
    4215   $filename = $filenamedir."/indications_additional.conf"; 
    4216  
    4217         if (($fd = fopen($filename, "w")) === false) { 
    4218       $desc = sprintf(_("Failed to open %s for writing, aborting attempt to write the country indications. The file may be readonly or the permissions may be incorrect."), $filename); 
    4219                 $notify->add_error('core','INDICATIONS',_("Failed to write indications_additional.conf"), $desc); 
    4220                 return; 
    4221         } 
    4222         $notify->delete('core', 'INDICATIONS'); 
     4212  fwrite($fd, "[general]\ncountry=".$result['value']."\n\n"); 
    42234213 
    42244214  $zonelist = general_get_zonelist(); 
    42254215  foreach ($zonelist as $zone) { 
    4226     if ($zone['iso'] == $result['value']){ 
    42274216    fwrite($fd, "[{$zone['iso']}]\n{$zone['conf']}\n\n"); 
    4228     } 
    42294217  } 
    42304218  fclose($fd);