Changeset 5450

Show
Ignore:
Timestamp:
12/11/07 12:06:25 (5 years ago)
Author:
p_lindheimer
Message:

moved all sip.conf and iax.conf settings into _general_additional.conf files for auto-generation and modified core_conf to add iax file, as well as added the auto-generation of the required core settings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.4/core/etc/extensions.conf

    r5348 r5450  
     1; do not edit this file, this is an auto-generated file by freepbx 
     2; all modifications must be done from the web gui 
     3 
    14; FreePBX 
    25; Copyright (C) 2004 Coalescent Systems Inc (Canada) 
    36; Copyright (C) 2006 Why Pay More 4 Less Pty Ltd (Australia) 
     7; Copyright (C) 2007 Astrogen LLC (USA) 
    48; Released under the GNU GPL Licence version 2. 
    59 
  • modules/branches/2.4/core/etc/iax.conf

    r5234 r5450  
     1; do not edit this file, this is an auto-generated file by freepbx 
     2; all modifications must be done from the web gui 
     3 
    14[general] 
    2 bindport = 4569           ; Port to bind to (IAX is 4569) 
    3 bindaddr = 0.0.0.0    ; Address to bind to (all addresses on machine) 
    4 disallow=all 
    5 allow=ulaw 
    6 allow=alaw 
    7 allow=gsm 
    8 mailboxdetail=yes 
    95 
     6; These will all be included in the [general] context 
     7#include iax_general_additional.conf 
    108#include iax_general_custom.conf 
    119#include iax_registrations_custom.conf 
    1210#include iax_registrations.conf 
     11 
     12; These should all be expected to come after the [general] context 
     13; 
    1314#include iax_custom.conf 
    1415#include iax_additional.conf 
  • modules/branches/2.4/core/etc/sip.conf

    r5234 r5450  
    1 ; Note: If your SIP devices are behind a NAT and your Asterisk 
    2 ;  server isn't, try adding "nat=1" to each peer definition to 
    3 ;  solve translation problems. 
     1; do not edit this file, this is an auto-generated file by freepbx 
     2; all modifications must be done from the web gui 
    43 
    54[general] 
    6 #include sip_general_additional.conf 
    7  
    8 bindport = 5060           ; Port to bind to (SIP is 5060) 
    9 bindaddr = 0.0.0.0    ; Address to bind to (all addresses on machine) 
    10 disallow=all 
    11 allow=ulaw 
    12 allow=alaw 
    13 ; If you need to answer unauthenticated calls, you should change this 
    14 ; next line to 'from-trunk', rather than 'from-sip-external'. 
    15 ; You'll know this is happening if when you call in you get a message 
    16 ; saying "The number you have dialed is not in service. Please check the 
    17 ; number and try again." 
    18 context = from-sip-external ; Send unknown SIP callers to this context 
    19 callerid = Unknown 
    20 tos=0x68 
    21  
    22 ; Reported as required for Asterisk 1.4 
    23 notifyringing=yes 
    24 notifyhold=yes 
    25 limitonpeers=yes 
    26  
     5
    276; enable and force the sip jitterbuffer. If these settings are desired 
    287; they should be set in the sip_general_custom.conf file as this file 
     
    3211; jbforce=yes 
    3312 
    34 ; #, in this configuration file, is NOT A COMMENT. This is exactly 
    35 ; how it should be. 
     13; These will all be included in the [general] context 
     14
     15#include sip_general_additional.conf 
    3616#include sip_general_custom.conf 
    3717#include sip_nat.conf 
    3818#include sip_registrations_custom.conf 
    3919#include sip_registrations.conf 
     20 
     21; These should all be expected to come after the [general] context 
     22; 
    4023#include sip_custom.conf 
    4124#include sip_additional.conf 
  • modules/branches/2.4/core/functions.inc.php

    r5386 r5450  
    1515      $files[] = 'sip_general_additional.conf'; 
    1616    } 
     17    if (isset($this->_iax_general) && is_array($this->_iax_general)) { 
     18      $files[] = 'iax_general_additional.conf'; 
     19    } 
    1720    return $files; 
    1821  } 
     
    3235        return $this->generate_sip_registrations($version); 
    3336        break; 
     37      case 'iax_general_additional.conf': 
     38        return $this->generate_iax_general_additional($version); 
     39        break; 
    3440      case 'iax_additional.conf': 
    3541        return $this->generate_iax_additional($version); 
     
    4551 
    4652  function addSipGeneral($key, $value) { 
    47     $this->_sip_general[$key] = $value
     53    $this->_sip_general[] = array('key' => $key, 'value' => $value)
    4854  } 
    4955 
     
    5258 
    5359    if (isset($this->_sip_general) && is_array($this->_sip_general)) { 
    54       foreach ($this->_sip_general as $key => $value) { 
    55         $output .= "$key=$value\n"; 
     60      foreach ($this->_sip_general as $values) { 
     61        $output .= $values['key']."=".$values['value']."\n"; 
     62      } 
     63    } 
     64    return $output; 
     65  } 
     66 
     67  function addIaxGeneral($key, $value) { 
     68    $this->_iax_general[] = array('key' => $key, 'value' => $value); 
     69  } 
     70 
     71  function generate_iax_general_additional($ast_version) { 
     72    $output = ''; 
     73 
     74    if (isset($this->_iax_general) && is_array($this->_iax_general)) { 
     75      foreach ($this->_iax_general as $values) { 
     76        $output .= $values['key']."=".$values['value']."\n"; 
    5677      } 
    5778    } 
     
    403424  global $version;  // this is not the best way to pass this, this should be passetd together with $engine 
    404425  global $amp_conf; 
     426  global $core_conf; 
    405427 
    406428  $modulename = "core"; 
     
    408430  switch($engine) { 
    409431    case "asterisk": 
     432 
     433      // Now add to sip_general_addtional.conf 
     434      // 
     435      if (isset($core_conf) && is_a($core_conf, "core_conf")) { 
     436        $core_conf->addSipGeneral('bindport','5060'); 
     437        $core_conf->addSipGeneral('bindaddr','0.0.0.0'); 
     438        $core_conf->addSipGeneral('disallow','all'); 
     439        $core_conf->addSipGeneral('allow','ulaw'); 
     440        $core_conf->addSipGeneral('allow','alaw'); 
     441        $core_conf->addSipGeneral('context','from-sip-external'); 
     442        $core_conf->addSipGeneral('callerid','Unknown'); 
     443        $core_conf->addSipGeneral('tos','0x68'); // This really doesn't do anything with astersk not running as root 
     444        $core_conf->addSipGeneral('notifyringing','yes'); 
     445        if (version_compare($ast_version, "1.4", "ge")) {  
     446          $core_conf->addSipGeneral('notifyhold','yes'); 
     447          $core_conf->addSipGeneral('limitonpeers','yes'); 
     448        } 
     449        $core_conf->addIaxGeneral('bindport','4569'); 
     450        $core_conf->addIaxGeneral('bindaddr','0.0.0.0'); 
     451        $core_conf->addIaxGeneral('disallow','all'); 
     452        $core_conf->addIaxGeneral('allow','ulaw'); 
     453        $core_conf->addIaxGeneral('allow','alaw'); 
     454        $core_conf->addIaxGeneral('allow','gsm'); 
     455        $core_conf->addIaxGeneral('mailboxdetail','yes'); 
     456      } 
     457 
    410458      // FeatureCodes 
    411459      $fcc = new featurecode($modulename, 'userlogon'); 
  • modules/branches/2.4/core/module.xml

    r5447 r5450  
    44  <category>Basic</category> 
    55  <name>Core</name> 
    6   <version>2.4.0beta1.0</version> 
     6  <version>2.4.0beta1.1</version> 
    77  <candisable>no</candisable> 
    88  <canuninstall>no</canuninstall> 
    99  <changelog> 
     10    *2.4.0beta1.1* moved all sip.conf and iax.conf settings into _general_additional.conf files for auto-generation 
    1011    *2.4.0beta1.0* addition of zapchandids page and removal of Channel in inbound routes, Extension/Destination Registry support, Adhoc Device 
    1112                   and login/out improvments. Added ringing to Terminate Call Destinations,  #2493, #1974, #2470, #1697, #2357, #2393 pinless dialing