summaryrefslogtreecommitdiff
path: root/xpp/utils/zconf/Zaptel.pm
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/utils/zconf/Zaptel.pm')
-rw-r--r--xpp/utils/zconf/Zaptel.pm43
1 files changed, 42 insertions, 1 deletions
diff --git a/xpp/utils/zconf/Zaptel.pm b/xpp/utils/zconf/Zaptel.pm
index 3717e72..e9d0529 100644
--- a/xpp/utils/zconf/Zaptel.pm
+++ b/xpp/utils/zconf/Zaptel.pm
@@ -10,8 +10,36 @@ package Zaptel;
use strict;
use Zaptel::Span;
+=head1 NAME
+
+Zaptel - Perl interface to Zaptel information
+
+This package allows access from perl to information about Zaptel
+hardware and loaded Zaptel devices.
+
+=head1 SYNOPSIS
+
+ # Listing channels in analog spans:
+ use Zaptel;
+ # scans system:
+ my @xbuses = Zaptel::spans();
+ for my $span (@spans) {
+ next if ($span->is_digital);
+ $span->num. " - [". $span->type ."] ". $span->name. "\n";
+ for my $chan ($span->chans) {
+ print " - ".$chan->num . " - [". $chan->type. "] ". $chan->fqn". \n";
+ }
+ }
+=cut
+
my $proc_base = "/proc/zaptel";
+=head1 spans()
+
+Returns a list of span objects, ordered by span number.
+
+=cut
+
sub spans() {
my @spans;
@@ -21,7 +49,20 @@ sub spans() {
my $span = Zaptel::Span->new($zfile);
push(@spans, $span);
}
- return sort { $a->num <=> $b->num } @spans;
+ @spans = sort { $a->num <=> $b->num } @spans;
+ return @spans;
}
+=head1 SEE ALSO
+
+Span objects: L<Zaptel::Span>.
+
+Zaptel channels objects: L<Zaptel::Chan>.
+
+Zaptel hardware devices information: L<Zaptel::Hardware>.
+
+Xorcom Astribank -specific information: L<Zaptel::Xpp>.
+
+=cut
+
1;