summaryrefslogtreecommitdiff
path: root/xpp/utils/lszaptel
blob: ecb8ced69690e7fabac77a41552d5eb7bb50588c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /usr/bin/perl -w
#
# Written by Oron Peled <oron@actcom.co.il>
# Copyright (C) 2007, Xorcom
# This program is free software; you can redistribute and/or
# modify it under the same terms as Perl itself.
#
# $Id$
#
use strict;
BEGIN { my $dir = $0; $dir =~ s:/[^/]+$::; unshift(@INC, "$dir", "$dir/zconf"); }

use Zaptel;
use Zaptel::Span;

foreach my $span (Zaptel::spans()) {
	printf "### Span %2d: %s %s\n", $span->num, $span->name, $span->description;
	foreach my $chan ($span->chans()) {
		my %type_map = (
			OUT	=> 'Output',
			IN	=> 'Input'
			);
		my ($type) = map { $type_map{$_} or $_ } $chan->type;
		printf "%3d %-10s %-10s %s\n", $chan->num, $type, $chan->signalling, $chan->info;
	}
}

__END__

=head1 NAME

lszaptel - List all zaptel channels with their types and spans.

=head1 SYNOPSIS

lszaptel

=head1 DESCRIPTION

Example output:

	### Span  1: XBUS-03/XPD-00 "Xorcom XPD #3/0: FXS"
	  1 FXS
	  2 FXS
	  3 FXS
	  4 FXS
	  5 FXS
	  6 FXS
	  7 FXS
	  8 FXS
	  9 Output
	 10 Output
	 11 Input
	 12 Input
	 13 Input
	 14 Input