dahdi_genconf: apply termtype to Digium HA8 BRI
Make the pri_termtype setting in genconf_parameters apply to any BRI/PRI carddeclared as "soft NT". ATM, this is only the Xorcom E1/T1 device and the Digium HA8 (BRI) module of the TDM card. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@9979 17933a7a-c749-41c5-a318-cba88f637d49
This commit is contained in:
parent
178ae27825
commit
f46df849da
@ -38,7 +38,7 @@ sub spans_prep($@) {
|
||||
my $gconfig = shift || die;
|
||||
my @spans = @_;
|
||||
foreach my $span (@spans) {
|
||||
if($span->is_pri) {
|
||||
if($span->is_pri || $span->is_bri) {
|
||||
$span->pri_set_fromconfig($gconfig);
|
||||
}
|
||||
}
|
||||
|
@ -151,6 +151,11 @@ my @pri_strings = (
|
||||
'WP(E1|T1)/.* "wanpipe', # Sangoma E1/T1
|
||||
);
|
||||
|
||||
my @soft_term_type_strings = (
|
||||
'Xorcom XPD.*: (E1|T1)', # Astribank PRI
|
||||
'(WCBRI)', # has selectable NT/TE modes via dahdi_cfg
|
||||
);
|
||||
|
||||
our $DAHDI_BRI_NET = 'bri_net';
|
||||
our $DAHDI_BRI_CPE = 'bri_cpe';
|
||||
|
||||
@ -196,6 +201,7 @@ sub new($$) {
|
||||
$self->{TYPE} = "BRI_$termtype";
|
||||
$self->{DCHAN_IDX} = 2;
|
||||
$self->{BCHAN_LIST} = [ 0, 1 ];
|
||||
$self->init_proto('BRI');
|
||||
last;
|
||||
}
|
||||
}
|
||||
@ -217,6 +223,13 @@ sub new($$) {
|
||||
last;
|
||||
}
|
||||
}
|
||||
$self->{IS_SOFT_TERM_TYPE} = 0;
|
||||
foreach my $cardtype (@soft_term_type_strings) {
|
||||
if($head =~ m/$cardtype/) {
|
||||
$self->{IS_SOFT_TERM_TYPE} = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
($self->{NAME}, $self->{DESCRIPTION}) = (split(/\s+/, $head, 4))[2, 3];
|
||||
$self->{IS_DAHDI_SYNC_MASTER} =
|
||||
($self->{DESCRIPTION} =~ /\(MASTER\)/) ? 1 : 0;
|
||||
@ -305,7 +318,11 @@ sub set_termtype($$) {
|
||||
my $span = shift || die;
|
||||
my $termtype = shift || die;
|
||||
$span->{TERMTYPE} = $termtype;
|
||||
$span->{SIGNALLING} = ($termtype eq 'NT') ? $DAHDI_PRI_NET : $DAHDI_PRI_CPE ;
|
||||
if ($span->is_pri) {
|
||||
$span->{SIGNALLING} = ($termtype eq 'NT') ? $DAHDI_PRI_NET : $DAHDI_PRI_CPE ;
|
||||
} elsif ($span->is_bri) {
|
||||
$span->{SIGNALLING} = ($termtype eq 'NT') ? $DAHDI_BRI_NET : $DAHDI_BRI_CPE ;
|
||||
}
|
||||
$span->{TYPE} = $span->proto . "_$termtype";
|
||||
}
|
||||
|
||||
@ -313,6 +330,7 @@ sub pri_set_fromconfig($$) {
|
||||
my $span = shift || die;
|
||||
my $genconf = shift || die;
|
||||
my $name = $span->name;
|
||||
return unless $span->is_soft_term_type;
|
||||
# if(defined $termtype) {
|
||||
# die "Termtype for $name already defined as $termtype\n";
|
||||
# }
|
||||
|
Loading…
Reference in New Issue
Block a user