~vibhavp/ubuntu/raring/dahdi-tools/merge-from-debian

« back to all changes in this revision

Viewing changes to xpp/perl_modules/Dahdi/Span.pm

  • Committer: Vibhav Pant
  • Date: 2012-12-26 17:23:16 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: vibhavp@gmail.com-20121226172316-o2jojsfcnr0aqrme
* Merge from Debian unstable. Remaining changes:
  - Bug Fix: If linux-headers are not installed, don't block, and print
    information for the user.
  - added debian/dahdi.postinst
  - added --error-handler=init_failed to debian/rules
  - debian/control: Added gawk as dependency for dkms build (LP: #493304)
  - Changes from Debian:
    - debian/control: Change Maintainer
    - debian/control: Removed Uploaders field.
    - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
    - debian/control: Package dahdi Depends on dahdi-dkms | dahdi-source 

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# This program is free software; you can redistribute and/or
6
6
# modify it under the same terms as Perl itself.
7
7
#
8
 
# $Id: Span.pm 9742 2011-02-08 14:12:51Z tzafrir $
 
8
# $Id: Span.pm 10186 2011-09-07 07:10:28Z tzafrir $
9
9
#
10
10
use strict;
11
11
use Dahdi::Utils;
151
151
                'WP(E1|T1)/.* "wanpipe',           # Sangoma E1/T1
152
152
                );
153
153
 
 
154
my @soft_term_type_strings = (
 
155
                'Xorcom XPD.*: (E1|T1)',           # Astribank PRI
 
156
                '(WCBRI)', # has selectable NT/TE modes via dahdi_cfg
 
157
);
 
158
 
154
159
our $DAHDI_BRI_NET = 'bri_net';
155
160
our $DAHDI_BRI_CPE = 'bri_cpe';
156
161
 
196
201
                        $self->{TYPE} = "BRI_$termtype";
197
202
                        $self->{DCHAN_IDX} = 2;
198
203
                        $self->{BCHAN_LIST} = [ 0, 1 ];
 
204
                        $self->init_proto('BRI');
199
205
                        last;
200
206
                }
201
207
        }
217
223
                        last;
218
224
                }
219
225
        }
 
226
        $self->{IS_SOFT_TERM_TYPE} = 0;
 
227
        foreach my $cardtype (@soft_term_type_strings) {
 
228
                if($head =~ m/$cardtype/) {
 
229
                        $self->{IS_SOFT_TERM_TYPE} = 1;
 
230
                        last;
 
231
                }
 
232
        }
220
233
        ($self->{NAME}, $self->{DESCRIPTION}) = (split(/\s+/, $head, 4))[2, 3];
221
234
        $self->{IS_DAHDI_SYNC_MASTER} =
222
235
                ($self->{DESCRIPTION} =~ /\(MASTER\)/) ? 1 : 0;
223
236
        $self->{CHANS} = [];
224
237
        my @channels;
225
238
        my $index = 0;
226
 
        while(<F>) {
 
239
        my @channel_lines = <F>;
 
240
        foreach (@channel_lines) {
227
241
                chomp;
228
242
                s/^\s*//;
229
243
                s/\s*$//;
305
319
        my $span = shift || die;
306
320
        my $termtype = shift || die;
307
321
        $span->{TERMTYPE} = $termtype;
308
 
        $span->{SIGNALLING} = ($termtype eq 'NT') ? $DAHDI_PRI_NET : $DAHDI_PRI_CPE ;
 
322
        if ($span->is_pri) {
 
323
                $span->{SIGNALLING} = ($termtype eq 'NT') ? $DAHDI_PRI_NET : $DAHDI_PRI_CPE ;
 
324
        } elsif ($span->is_bri) {
 
325
                $span->{SIGNALLING} = ($termtype eq 'NT') ? $DAHDI_BRI_NET : $DAHDI_BRI_CPE ;
 
326
        }
309
327
        $span->{TYPE} = $span->proto . "_$termtype";
310
328
}
311
329
 
313
331
        my $span = shift || die;
314
332
        my $genconf = shift || die;
315
333
        my $name = $span->name;
 
334
        return unless $span->is_soft_term_type;
316
335
#       if(defined $termtype) {
317
336
#               die "Termtype for $name already defined as $termtype\n";
318
337
#       }
349
368
                #print STDERR "match: $match\n";
350
369
                foreach my $pattern (@patlist) {
351
370
                        #print STDERR "testmatch: $pattern =~ $match\n";
352
 
                        if($pattern =~ $match) {
 
371
                        if($pattern =~ /^$match$/) {
353
372
                                #print STDERR "MATCH '$pattern' ~ '$match' termtype=$termtype\n";
354
373
                                $match_termtype = $termtype;
355
374
                                last SPEC;