bf3fe05dfb
This needs some more testing before it's on by default. If the card is otherwise functioning, these messages may be confusing to the user. If the card is not functioning, the driver can be reloaded with debug to check for this condition. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9205 a0bf4364-ded3-4de4-8d8a-66a801d63aff
39 lines
830 B
Perl
39 lines
830 B
Perl
package XppConfig;
|
|
#
|
|
# Written by Oron Peled <oron@actcom.co.il>
|
|
# Copyright (C) 2008, Xorcom
|
|
# This program is free software; you can redistribute and/or
|
|
# modify it under the same terms as Perl itself.
|
|
#
|
|
# $Id$
|
|
#
|
|
use strict;
|
|
|
|
my $conf_file = "/etc/dahdi/xpp.conf";
|
|
|
|
sub import {
|
|
my $pack = shift || die "Import without package?";
|
|
my $init_dir = shift || die "$pack::import -- missing init_dir parameter";
|
|
my $local_conf = "$init_dir/xpp.conf";
|
|
$conf_file = $local_conf if -r $local_conf;
|
|
}
|
|
|
|
sub read_config($) {
|
|
my $opts = shift || die;
|
|
|
|
open(F, $conf_file) || return ();
|
|
while(<F>) {
|
|
chomp;
|
|
s/#.*//; # strip comments
|
|
next unless /\S/;
|
|
s/\s*$//; # Trim trailing whitespace
|
|
my ($key, $value) = split(/\s+/, $_, 2);
|
|
$opts->{$key} = $value;
|
|
}
|
|
close F;
|
|
$opts->{'xppconf'} = $conf_file;
|
|
return %{$opts};
|
|
}
|
|
|
|
1;
|