summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-06-16 09:35:32 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-06-16 09:35:32 +0000
commite6cb9220161b1c4cd06533c9572e6285b4bf630c (patch)
treebf43aa1df79cf4cea04ff3f08bf186e22107bf52
parentae034293d9af863e3bb629ded097124684253aef (diff)
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.asterisk.org/svn/dahdi/tools/trunk@9979 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rwxr-xr-xxpp/dahdi_genconf2
-rw-r--r--xpp/perl_modules/Dahdi/Span.pm20
2 files changed, 20 insertions, 2 deletions
diff --git a/xpp/dahdi_genconf b/xpp/dahdi_genconf
index 49b9325..ac0acf9 100755
--- a/xpp/dahdi_genconf
+++ b/xpp/dahdi_genconf
@@ -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);
}
}
diff --git a/xpp/perl_modules/Dahdi/Span.pm b/xpp/perl_modules/Dahdi/Span.pm
index 5e13f04..367ca08 100644
--- a/xpp/perl_modules/Dahdi/Span.pm
+++ b/xpp/perl_modules/Dahdi/Span.pm
@@ -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";
# }