[Pkg-voip-commits] r3352 - freepbx/modules-2.2/modules/freepbx-module-zapauto/share

Tzafrir Cohen tzafrir-guest at alioth.debian.org
Sat Mar 31 22:23:02 UTC 2007


Author: tzafrir-guest
Date: 2007-03-31 22:23:02 +0000 (Sat, 31 Mar 2007)
New Revision: 3352

Modified:
   freepbx/modules-2.2/modules/freepbx-module-zapauto/share/detect_zap
   freepbx/modules-2.2/modules/freepbx-module-zapauto/share/zap2amp
Log:
* zap2amp: we should configure NTs, not TEs.
* zap2amp: default BRI spans to ptmp.
* detect_zap: fix permissions of zaptel.conf


Modified: freepbx/modules-2.2/modules/freepbx-module-zapauto/share/detect_zap
===================================================================
--- freepbx/modules-2.2/modules/freepbx-module-zapauto/share/detect_zap	2007-03-31 10:14:38 UTC (rev 3351)
+++ freepbx/modules-2.2/modules/freepbx-module-zapauto/share/detect_zap	2007-03-31 22:23:02 UTC (rev 3352)
@@ -72,8 +72,9 @@
 /etc/init.d/asterisk restart
 
 echo ' * Generating amportal configuration'
-chown asterisk. /etc/asterisk/zapata*
+chown asterisk: /etc/asterisk/zapata*
 chmod g+rw /etc/asterisk/zapata*
+chmod o+r /etc/zaptel.conf
 su $AST_USER -s $AST_SHELL -c /usr/share/freepbx-common/zap2amp
 su $AST_USER -s $AST_SHELL -c /usr/share/asterisk/bin/retrieve_conf
 su $AST_USER -s $AST_SHELL -c /usr/share/freepbx-common/fix_ast_db

Modified: freepbx/modules-2.2/modules/freepbx-module-zapauto/share/zap2amp
===================================================================
--- freepbx/modules-2.2/modules/freepbx-module-zapauto/share/zap2amp	2007-03-31 10:14:38 UTC (rev 3351)
+++ freepbx/modules-2.2/modules/freepbx-module-zapauto/share/zap2amp	2007-03-31 22:23:02 UTC (rev 3352)
@@ -25,7 +25,10 @@
 # mysql, and writing to asterisk DB
 #
 # the basis of the configurtaion will be taken from a template
-# which will be applied to each FXS channel found
+# which will be applied to each FXS channel found.
+#
+# Digital NT spans will be consideted some sort of "phones". They
+# will be assumed to be ISDN PRI/BRI and configured accordingly.
 
 use strict;
 use DBI;
@@ -364,7 +367,7 @@
 		$astbanktype = $1;
 	}
 	elsif ( ($line =~ /\s*bchan\s*=\s*([0-9]*)(-([0-9]*|))/) && 
-	  ($termtype eq 'te') ) 
+	  ($termtype eq 'nt') ) 
 	{
 		my $chan = $1;
 		my $chan_last = $chan;
@@ -375,10 +378,16 @@
 			$chan_last = $3;
 		}
 
+		# FIXME: we guess the signalling from the span length
+		# and not using what genzaptelconf used:
+		my $signalling = 'pri_net';
+		if ($chan_last - $chan == 1) {
+			$signalling = 'bri_net_ptmp';
+		}
 		for my $i ($chan .. $chan_last) 
 		{
 			reg_channel($i,{
-				SIGNALLING=>'bri_cpe', 
+				SIGNALLING=>$signalling, 
 				SWITCHTYPE=>'euroisdn'
 			});
 		}




More information about the Pkg-voip-commits mailing list