summaryrefslogtreecommitdiff
path: root/xpp/utils/zapconf
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/utils/zapconf')
-rwxr-xr-xxpp/utils/zapconf38
1 files changed, 27 insertions, 11 deletions
diff --git a/xpp/utils/zapconf b/xpp/utils/zapconf
index 1144684..196e57a 100755
--- a/xpp/utils/zapconf
+++ b/xpp/utils/zapconf
@@ -22,19 +22,27 @@ my %default_context = (
OUT => 'astbank-output',
BRI_TE => 'from-pstn',
BRI_NT => 'from-internal',
- PRI_TE => 'from-pstn',
- PRI_NT => 'from-internal',
+ E1_TE => 'from-pstn',
+ T1_TE => 'from-pstn',
+ J1_TE => 'from-pstn',
+ E1_NT => 'from-internal',
+ T1_NT => 'from-internal',
+ J1_NT => 'from-internal',
);
my %default_group = (
FXO => 0,
- FXS => 5,
- IN => 5, # FIXME: no need for group?
- OUT => 5, # FIXME: no need for group?
+ FXS => "5",
+ IN => '',
+ OUT => '',
BRI_TE => 0,
- BRI_NT => 5,
- PRI_TE => 0,
- PRI_NT => 5,
+ BRI_NT => 6,
+ E1_TE => 0,
+ T1_TE => 0,
+ J1_TE => 0,
+ E1_NT => 6,
+ T1_NT => 6,
+ J1_NT => 6,
);
my $fxs_default_start = 'ls';
@@ -151,7 +159,7 @@ sub gen_zaptel_signalling($) {
my $type = $chan->type;
my $num = $chan->num;
- die "channel $num type $type is not an analog channel\n" if $chan->is_digital();
+ die "channel $num type $type is not an analog channel\n" if $chan->span->is_digital();
if($type eq 'EMPTY') {
printf "# channel %d, %s, no module.\n", $num, $chan->fqn;
return;
@@ -264,7 +272,7 @@ sub gen_zapata_channel($) {
my $chan = shift || die;
my $type = $chan->type;
my $num = $chan->num;
- die "channel $num type $type is not an analog channel\n" if $chan->is_digital();
+ die "channel $num type $type is not an analog channel\n" if $chan->span->is_digital();
my $exten = $base_exten + $num;
my $sig = $default_zapata_signalling{$type};
my $context = $default_context{$type};
@@ -343,7 +351,7 @@ sub gen_users_channel($) {
my $chan = shift || die;
my $type = $chan->type;
my $num = $chan->num;
- die "channel $num type $type is not an analog channel\n" if $chan->is_digital();
+ die "channel $num type $type is not an analog channel\n" if $chan->span->is_digital();
my $exten = $base_exten + $num;
my $sig = $default_zapata_signalling{$type};
my $full_name = "$type $num";
@@ -379,6 +387,14 @@ allow = all
EOF
}
+# generate users.conf . The specific users.conf is strictly oriented
+# towards using with the asterisk-gui .
+#
+# This code could have generated a much simpler and smaller
+# configuration file, had there been minimal level of support for
+# configuration templates in the asterisk configuration rewriting. Right
+# now Asterisk's configuration rewriting simply freaks out in the face
+# of templates: http://bugs.digium.com/11442 .
sub gen_usersconf($) {
my $file = shift || die;
rename "$file", "$file.bak"