~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to kernel/xpp/utils/lszaptel

  • Committer: Bazaar Package Importer
  • Author(s): Tzafrir Cohen
  • Date: 2008-08-28 22:58:23 UTC
  • mfrom: (11.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080828225823-r8bdunirm8hmc76m
Tags: 1:1.4.11~dfsg-2
* Patch xpp_fxs_power: Fixed an issue with hook detection of the Astribank
  FXS module.
* Don't fail init.d script if fxotune fails. This may happen if running it
  when Asterisk is already running.
* Bump standards version to 3.8.0.0 .
* Ignore false lintian warning ("m-a a-i" has "a a").
* Patch xpp_fxo_cid_always: do always pass PCM if that's what the user
  asked.
* Patch vzaphfc_proc_root_dir: fix vzaphfc on 2.6.26.
* Patch wcte12xp_flags: Proper time for irq save flags.
* Patch headers_2627: Fix location of semaphore.h for 2.6.27 .
* Patch xpp_fxs_dtmf_leak: Don't play DTMFs to the wrong channel.
* Patch wctdm_fix_alarm: Fix sending channel alarms.
* Patch device_class_2626: Fix building 2.6.26 (Closes: #493397).
* Using dh_lintian for lintian overrides, hence requiring debhelper 6.0.7.
* Lintian: we know we have direct changes. Too bad we're half-upstream :-(
* Fix doc-base section names. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/perl -w
 
2
#
 
3
# Written by Oron Peled <oron@actcom.co.il>
 
4
# Copyright (C) 2007, Xorcom
 
5
# This program is free software; you can redistribute and/or
 
6
# modify it under the same terms as Perl itself.
 
7
#
 
8
# $Id: lszaptel 3793 2008-02-04 23:00:48Z tzafrir $
 
9
#
 
10
use strict;
 
11
use File::Basename;
 
12
BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
 
13
 
 
14
use Zaptel;
 
15
use Zaptel::Span;
 
16
use Zaptel::Xpp;
 
17
use Zaptel::Xpp::Xbus;
 
18
use Zaptel::Xpp::Xpd;
 
19
 
 
20
my @xbuses = Zaptel::Xpp::xbuses("SORT_CONNECTOR");
 
21
my @xpds = map { $_->xpds } @xbuses;
 
22
 
 
23
foreach my $span (Zaptel::spans()) {
 
24
        my $spanno = $span->num;
 
25
        my $xpd = $span->xpd;
 
26
        my @lines;
 
27
        my $index = 0;
 
28
 
 
29
        @lines = @{$xpd->lines} if defined $xpd;
 
30
        printf "### Span %2d: %s %s\n", $span->num, $span->name, $span->description;
 
31
        foreach my $chan ($span->chans()) {
 
32
                my %type_map = (
 
33
                        OUT     => 'Output',
 
34
                        IN      => 'Input'
 
35
                        );
 
36
                my ($type) = map { $type_map{$_} or $_ } $chan->type || ("unknown");
 
37
                my $batt = "";
 
38
                $batt = "(battery)" if $chan->battery;
 
39
                printf "%3d %-10s %-10s %s %s\n",
 
40
                        $chan->num, $type, $chan->signalling, $chan->info, $batt;
 
41
                $index++;
 
42
        }
 
43
}
 
44
 
 
45
__END__
 
46
 
 
47
=head1 NAME
 
48
 
 
49
lszaptel - List all zaptel channels with their types and spans.
 
50
 
 
51
=head1 SYNOPSIS
 
52
 
 
53
lszaptel
 
54
 
 
55
=head1 DESCRIPTION
 
56
 
 
57
Example output:
 
58
 
 
59
        ### Span  1: WCTDM/0 "Wildcard TDM400P REV E/F Board 1"
 
60
          1 FXO        FXOLS      (In use)
 
61
          2 FXS        FXSKS
 
62
          3 FXS        FXSKS
 
63
          4 FXS        FXSKS
 
64
        ### Span  2: XBUS-00/XPD-00 "Xorcom XPD #00/00: FXO"
 
65
          5 FXO        FXSKS      (In use)
 
66
          6 FXO        FXSKS      (In use) (no pcm)
 
67
          7 FXO        FXSKS      (In use) (no pcm)
 
68
          8 FXO        FXSKS      (In use) (no pcm)
 
69
          9 FXO        FXSKS      (In use) (no pcm)
 
70
         10 FXO        FXSKS      (In use) (no pcm)
 
71
         11 FXO        FXSKS      (In use) (no pcm)
 
72
         12 FXO        FXSKS      (In use) (no pcm)
 
73
        ### Span  3: XBUS-00/XPD-10 "Xorcom XPD #00/10: FXO"
 
74
         13 FXO        FXSKS      (In use) (no pcm)
 
75
         14 FXO        FXSKS      (In use) (no pcm)
 
76
         15 FXO        FXSKS      (In use) (no pcm)
 
77
         16 FXO        FXSKS      (In use) (no pcm)
 
78
         17 FXO        FXSKS      (In use) (no pcm)
 
79
         18 FXO        FXSKS      (In use) (no pcm)
 
80
         19 FXO        FXSKS      (In use) (no pcm)
 
81
         20 FXO        FXSKS      (In use) (no pcm)
 
82
 
 
83
        ...
 
84
 
 
85
        ### Span  6: XBUS-01/XPD-00 "Xorcom XPD #01/00: FXS"
 
86
         37 FXS        FXOLS      (In use)
 
87
         38 FXS        FXOLS      (In use) (no pcm)
 
88
         39 FXS        FXOLS      (In use) (no pcm)
 
89
         40 FXS        FXOLS      (In use) (no pcm)
 
90
         41 FXS        FXOLS      (In use) (no pcm)
 
91
         42 FXS        FXOLS      (In use) (no pcm)
 
92
         43 FXS        FXOLS      (In use) (no pcm)
 
93
         44 FXS        FXOLS      (In use) (no pcm)
 
94
         45 Output     FXOLS      (In use) (no pcm)
 
95
         46 Output     FXOLS      (In use) (no pcm)
 
96
         47 Input      FXOLS      (In use) (no pcm)
 
97
         48 Input      FXOLS      (In use) (no pcm)
 
98
         49 Input      FXOLS      (In use) (no pcm)
 
99
         50 Input      FXOLS      (In use) (no pcm)
 
100
 
 
101
The first column is the type of the channel (port, for an analog device) 
 
102
and the second one is the signalling (if set).
 
103
 
 
104
=head1 FILES
 
105
 
 
106
lszaptel is a somewhat glorified 'cat /proc/zaptel/*' . Unlike that
 
107
command, it sorts the spans with the proper order. It also formats the
 
108
output slightly differently.