From 2a4e0ea037050d7178bd5728cc248f9925e51382 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 29 Sep 2009 19:28:58 +0000 Subject: xpp: more T1-CAS config generation support git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@7257 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- xpp/genconf_parameters | 2 ++ xpp/perl_modules/Dahdi/Config/Gen/System.pm | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/xpp/genconf_parameters b/xpp/genconf_parameters index ff839c7..e48e2b8 100644 --- a/xpp/genconf_parameters +++ b/xpp/genconf_parameters @@ -112,6 +112,8 @@ # Explicitly set the idle bits for E1 CAS (Sample value is the default): #r2_idle_bits 1101 # +# Set T1 framing type to d4 instead of esf: +#tdm_framing d4 # # Use E&M on CAS (default is FXS/FXO). If set, E1 spans will be used as # E&M-E1 and T1 will use the requested type: diff --git a/xpp/perl_modules/Dahdi/Config/Gen/System.pm b/xpp/perl_modules/Dahdi/Config/Gen/System.pm index eacfb15..d1dfe40 100644 --- a/xpp/perl_modules/Dahdi/Config/Gen/System.pm +++ b/xpp/perl_modules/Dahdi/Config/Gen/System.pm @@ -28,18 +28,28 @@ sub print_echo_can($$) { print "echocanceller=$echo_can,$chans\n"; } -sub gen_cas($$) { +sub gen_t1_cas($$) { my $self = shift || die; my $gconfig = shift || die; + my $parameters = $gconfig->{PARAMETERS} || die; + my $genconf_file = $parameters->{GENCONF_FILE} || die; my $span = shift || die; my $num = $span->num() || die; + my $proto = $span->proto || die; + die "Generate configuration for '$proto' is not possible. Maybe you meant R2?" + unless $proto eq 'T1'; my $pri_connection_type = $gconfig->{pri_connection_type} || die; die "Span #$num is analog" unless $span->is_digital(); - die "Span #$num is not CAS" unless $span->is_pri && $gconfig->{pri_connection_type} eq 'CAS'; + die "Span #$num is not CAS" unless $span->is_pri && $pri_connection_type eq 'CAS'; my $termtype = $span->termtype() || die "$0: Span #$num -- unkown termtype [NT/TE]\n"; my $timing; my $lbo = 0; - my $framing = $span->framing() || die "$0: No framing information for span #$num\n"; + my $framing = $gconfig->{tdm_framing}; + if(!defined $framing) { + $framing = 'esf'; + } elsif($framing ne 'esf' && $framing ne 'd4') { + die "T1-CAS valid framing is only 'esf' or 'd4'. Not '$framing'. Check '$genconf_file'\n"; + } my $coding = $span->coding() || die "$0: No coding information for span #$num\n"; my $span_crc4 = $span->crc4(); $span_crc4 = (defined $span_crc4) ? ",$span_crc4" : ''; -- cgit v1.2.3