diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-06-29 16:57:48 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-06-29 16:57:48 +0000 |
commit | 0fd300bf14ba0826ec96017886f3d26530c4368e (patch) | |
tree | 8cae5d7e1c7eeb5a476a6d1b0bd93a59b0fc5712 /xpp/dahdi_genconf | |
parent | 5156247998b357c16e8d634f2f938d218ea4cf12 (diff) |
dahdi_genconf configuration separated from the kernel config.
* Using /etc/dahdi/genconf_parameters.
* A shiny new format (sample file included).
* xpp_fxloader is configured from /etc/dahdi/init.conf (like the init.d
script).
* Yet some more string cleanups.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4484 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/dahdi_genconf')
-rwxr-xr-x | xpp/dahdi_genconf | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/xpp/dahdi_genconf b/xpp/dahdi_genconf index 378e8a9..2729427 100755 --- a/xpp/dahdi_genconf +++ b/xpp/dahdi_genconf @@ -15,6 +15,8 @@ use Dahdi; use Dahdi::Xpp; use Dahdi::Config::GenconfDefaults; +my $genconf_defaults; + my %default_context = ( FXO => 'from-pstn', FXS => 'from-internal', @@ -61,6 +63,7 @@ my %default_chan_dahdi_signalling = ( OUT => "fxo_{fxs_default_start}", ); +my $file = ''; my $base_exten = 4000; my $fxs_immediate = 'no'; my $lc_country = 'us'; @@ -68,8 +71,10 @@ my $loadzone = $lc_country; my $defaultzone = $lc_country; my $bri_sig_style = 'bri_ptmp'; my $brint_overlap = 'no'; +my $pri_termtype = 'SPAN/* TE'; my %dahdi_default_vars = ( + GENCONF_FILE => \$file, base_exten => \$base_exten, fxs_immediate => \$fxs_immediate, fxs_default_start => \$fxs_default_start, @@ -87,8 +92,9 @@ my %dahdi_default_vars = ( \$default_group{OUT}, ], group_lines => \$default_group{FXO}, - DAHDI_BRI_SIGNALLING => \$bri_sig_style, + bri_sig_style => \$bri_sig_style, brint_overlap => \$brint_overlap, + pri_termtype => \$pri_termtype, ); sub map_dahdi_defaults { @@ -110,6 +116,7 @@ sub map_dahdi_defaults { } foreach my $v (@vars) { $$v = $val; + #printf STDERR "%-20s %s\n", $v, $val; } } } @@ -217,7 +224,7 @@ sub gen_dahdiconf($) { print <<"HEAD"; # Dahdi Configuration File # -# This file is parsed by the Dahdi Configurator, ztcfg +# This file is parsed by the Dahdi Configurator, dahdi_cfg # HEAD foreach my $span (@spans) { @@ -530,9 +537,15 @@ sub gen_chan_dahdi_conf($) { sub set_defaults { # Source default files - my ($default_file, %source_defaults) = - Dahdi::Config::GenconfDefaults::source_vars(keys(%dahdi_default_vars)); - map_dahdi_defaults(%source_defaults); + my $default_file = $ENV{GENCONF_PARAMETERS} || "/etc/dahdi/genconf_parameters"; + $genconf_defaults = Dahdi::Config::GenconfDefaults->new($default_file); + #$genconf_defaults->dump; + map_dahdi_defaults(%$genconf_defaults); + foreach my $span (@spans) { + if($span->is_pri) { + $span->pri_set_fromconfig($genconf_defaults); + } + } # Fixups foreach my $val (values %default_dahdi_signalling, values %default_chan_dahdi_signalling) { $val =~ s/{fxs_default_start}/$fxs_default_start/g; @@ -581,7 +594,7 @@ Without arguments, it generates only dahdi and chan_dahdi. =item dahdi - /etc/dahdi/system.conf -Configuration for ztcfg(1). It's location may be overriden by the +Configuration for dahdi_cfg(1). It's location may be overriden by the environment variable DAHDI_CONF_FILE. =item chan_dahdi - /etc/asterisk/dahdi-channels.conf |