diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-03-21 01:51:39 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-03-21 01:51:39 +0000 |
commit | d2bf4b90b68c4010d46398858cbfc589e1d9ff54 (patch) | |
tree | 87b3f40ee02b4ea949acd2c9bf2113417a38a6b2 /kernel/xpp/utils/zconf/Zaptel/Xpp | |
parent | e0c4098698e7a7b4aa911c2bd292be398e78aa82 (diff) |
* Earleier initialization of PRI module's register.
* Fix zaptel-perl reporting of battery after procfs changes.
* Documentation updates.
* Block hdlcstress/test fixes that followed: already merged.
Merged revisions 4036 via svnmerge from
http://svn.digium.com/svn/zaptel/branches/1.2
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4039 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kernel/xpp/utils/zconf/Zaptel/Xpp')
-rw-r--r-- | kernel/xpp/utils/zconf/Zaptel/Xpp/Line.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/xpp/utils/zconf/Zaptel/Xpp/Line.pm b/kernel/xpp/utils/zconf/Zaptel/Xpp/Line.pm index e3e04f0..0014aed 100644 --- a/kernel/xpp/utils/zconf/Zaptel/Xpp/Line.pm +++ b/kernel/xpp/utils/zconf/Zaptel/Xpp/Line.pm @@ -39,15 +39,19 @@ sub create_all($$) { die "Failed globbing '$procdir/*_info'" unless defined $infofile; my $type = $xpd->type; open(F, "$infofile") || die "Failed opening '$infofile': $!"; + my $battery_info = 0; while (<F>) { chomp; if($type eq 'FXO') { - if(s/^\s*battery\s*:\s*//) { + $battery_info = 1 if /^Battery:/; + if($battery_info && s/^\s*on\s*:\s*//) { my @batt = split; foreach my $l (@lines) { die unless @batt; - $l->{BATTERY} = shift @batt; + my $state = shift @batt; + $l->{BATTERY} = ($state eq '+') ? 1 : 0; } + $battery_info = 0; die if @batt; } } |