summaryrefslogtreecommitdiff
path: root/xpp/utils/zapconf
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/utils/zapconf')
-rwxr-xr-xxpp/utils/zapconf29
1 files changed, 28 insertions, 1 deletions
diff --git a/xpp/utils/zapconf b/xpp/utils/zapconf
index dd6ab1f..7f94f6b 100755
--- a/xpp/utils/zapconf
+++ b/xpp/utils/zapconf
@@ -67,6 +67,7 @@ my $lc_country = 'us';
my $loadzone = $lc_country;
my $defaultzone = $lc_country;
my $bri_sig_style = 'bri_ptmp';
+my $brint_overlap = 'no';
my %zaptel_default_vars = (
base_exten => \$base_exten,
@@ -87,6 +88,7 @@ my %zaptel_default_vars = (
],
group_lines => \$default_group{FXO},
ZAPBRI_SIGNALLING => \$bri_sig_style,
+ brint_overlap => \$brint_overlap,
);
sub map_zaptel_defaults {
@@ -246,6 +248,25 @@ TAIL
select $old;
}
+my %DefaultConfigs = (
+ context => 'default',
+ group => '63', # FIXME: should not be needed.
+ overlapdial => 'no',
+ busydetect => 'no',
+ rxgain => 0,
+ txgain => 0,
+);
+
+sub reset_zapata_values {
+ foreach my $arg (@_) {
+ if (exists $DefaultConfigs{$arg}) {
+ print "$arg = $DefaultConfigs{$arg}\n";
+ } else {
+ print "$arg =\n";
+ }
+ }
+}
+
sub gen_zapata_digital($) {
my $span = shift || die;
my $num = $span->num() || die;
@@ -254,6 +275,7 @@ sub gen_zapata_digital($) {
my $termtype = $span->termtype() || die "$0: Span #$num -- unkown termtype [NT/TE]\n";
my $group = $default_group{"$type"};
my $context = $default_context{"$type"};
+ my @to_reset = qw/context group/;
die "$0: missing default group (termtype=$termtype)\n" unless defined($group);
die "$0: missing default context\n" unless $context;
@@ -263,13 +285,18 @@ sub gen_zapata_digital($) {
if($span->is_bri() and $bri_sig_style eq 'bri_ptmp') {
$sig .= '_ptmp';
}
+ if ($span->is_bri() && $termtype eq 'NT' && $brint_overlap eq 'yes') {
+ print "overlapdial = yes\n";
+ push(@to_reset, qw/overlapdial/);
+ }
+
$group .= "," . (10 + $num); # Invent unique group per span
printf "group=$group\n";
printf "context=$context\n";
printf "switchtype = %s\n", $span->switchtype;
printf "signalling = %s\n", $sig;
printf "channel => %s\n", bchan_range($span);
- printf "group=\ncontext=default\n";
+ reset_zapata_values(@to_reset);
}
sub gen_zapata_channel($) {