summaryrefslogtreecommitdiff
path: root/xpp/utils/zconf/Zaptel/Config
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 18:12:27 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 18:12:27 +0000
commit9899bafe997a4e020f302c99a6e025b4e8b25191 (patch)
tree8a108b05d0f319c95ba83f1d5984ae261572bebf /xpp/utils/zconf/Zaptel/Config
parent1d7d5b07325a186785b22abf09ff531dfc2edd54 (diff)
xpp.r5254:
* Improved polarity reversal hangups in FXO (r5194). Fixed false detection of polarity reversals. * Optimize xframe allocation, by not zeroing the whole memory (in get_xframe()). * Fixed erronous error message that appeared sometimes from fpga_load during USB renumeration. * Zaptel::Chans now provides battery() reporting for some FXO channels (Astribank FXO and wcfxo). git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3643 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils/zconf/Zaptel/Config')
-rw-r--r--xpp/utils/zconf/Zaptel/Config/Defaults.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/xpp/utils/zconf/Zaptel/Config/Defaults.pm b/xpp/utils/zconf/Zaptel/Config/Defaults.pm
index 05f4db3..1d11403 100644
--- a/xpp/utils/zconf/Zaptel/Config/Defaults.pm
+++ b/xpp/utils/zconf/Zaptel/Config/Defaults.pm
@@ -26,4 +26,29 @@ sub do_source($@) {
return %vars;
}
+sub source_vars {
+ my @vars = @_;
+ my $default_file;
+ my %system_files = (
+ "/etc/default/zaptel" => 'Debian and friends',
+ "/etc/sysconfig/zaptel" => 'Red Hat and friends',
+ );
+
+ if(defined $ENV{ZAPTEL_DEFAULTS}) {
+ $default_file = $ENV{ZAPTEL_DEFAULTS};
+ } else {
+ foreach my $f (keys %system_files) {
+ if(-r $f) {
+ if(defined $default_file) {
+ die "An '$f' collides with '$default_file'";
+ }
+ $default_file = $f;
+ }
+ }
+ }
+ die "No default_file" unless $default_file;
+ my %vars = Zaptel::Config::Defaults::do_source($default_file, @vars);
+ return ($default_file, %vars);
+}
+
1;