diff -u wancfg_zaptel/A10u.pm wancfg_zaptel_old/A10u.pm
--- wancfg_zaptel/A10u.pm	2007-06-06 14:06:08.000000000 -0400
+++ wancfg_zaptel_old/A10u.pm	2007-02-09 12:49:20.000000000 -0500
@@ -15,7 +15,6 @@
 		_fe_lcode  => 'B8ZS',
 		_fe_frame  => 'ESF',
 		_fe_clock  => 'NORMAL',
-		_te_ref_clock  => '0',
 		_signalling => 'PRI_CPE',
 		_pri_switchtype => 'national',
 		_hw_dchan  => '0',
@@ -34,11 +33,6 @@
 	        $self->{_fe_line} = $fe_line if defined($fe_line);
 		    return $self->{_fe_line};
 }
-sub te_ref_clock {
-	    my ( $self, $te_ref_clock ) = @_;
-	        $self->{_te_ref_clock} = $te_ref_clock if defined($te_ref_clock);
-		    return $self->{_te_ref_clock};
-}
 sub signalling {
 	    my ( $self, $signalling ) = @_;
 	    $self->{_signalling} = $signalling if defined($signalling);
diff -u wancfg_zaptel/A10x.pm wancfg_zaptel_old/A10x.pm
--- wancfg_zaptel/A10x.pm	2007-06-06 14:05:40.000000000 -0400
+++ wancfg_zaptel_old/A10x.pm	2007-02-09 12:49:20.000000000 -0500
@@ -16,7 +16,6 @@
 		_fe_lcode  => 'B8ZS',
 		_fe_frame  => 'ESF',
 		_fe_clock  => 'NORMAL',
-		_te_ref_clock  => '0',
 		_signalling => 'PRI_CPE',
 		_pri_switchtype => 'national',
 		_hw_dchan  => '0',
@@ -35,12 +34,6 @@
 	        $self->{_fe_line} = $fe_line if defined($fe_line);
 		    return $self->{_fe_line};
 }
-
-sub te_ref_clock {
-	    my ( $self, $te_ref_clock ) = @_;
-	        $self->{_te_ref_clock} = $te_ref_clock if defined($te_ref_clock);
-		    return $self->{_te_ref_clock};
-}
 sub signalling {
 	    my ( $self, $signalling ) = @_;
 	    $self->{_signalling} = $signalling if defined($signalling);
@@ -141,23 +134,17 @@
 	my $fe_frame = $self->fe_frame;
 	my $fe_line = $self->fe_line;
 	my $fe_clock = $self->fe_clock;
-	my $te_ref_clock = $self->te_ref_clock;
-	my $te_sig_mode = '';
 	my $hwec_mode = $self->card->hwec_mode;
 	my $dchan = 0;
 	my $fe_lbo;
         if ($self->fe_media eq 'T1'){
 		if ($self->signalling eq 'PRI CPE' | $self->signalling eq 'PRI NET'){
-			  $te_sig_mode = '';	
 			  $dchan = 24;
 		}
 		$fe_lbo='0DB';
 	}else{
 		if ($self->signalling eq 'PRI CPE' | $self->signalling eq 'PRI NET'){
 			  $dchan = 16;
-		  	  $te_sig_mode = 'TE_SIG_MODE     = CCS';
-		} else {
-			  $te_sig_mode = 'TE_SIG_MODE     = CAS';
 		}
 		$fe_lbo='120OH';
 	}
@@ -176,9 +163,7 @@
         $wp_file =~ s/FELCODE/$fe_lcode/g;
         $wp_file =~ s/FEFRAME/$fe_frame/g;
         $wp_file =~ s/FELINE/$fe_line/g;
-	$wp_file =~ s/TESIGMODE/$te_sig_mode/g;
         $wp_file =~ s/FECLOCK/$fe_clock/g;
-	$wp_file =~ s/TEREFCLOCK/$te_ref_clock/g;
         $wp_file =~ s/FELBO/$fe_lbo/g;
         $wp_file =~ s/TDMVDCHAN/$dchan/g;
         $wp_file =~ s/HWECMODE/$hwec_mode/g;
Only in wancfg_zaptel: .A10x.pm.swp
diff -u wancfg_zaptel/A20x.pm wancfg_zaptel_old/A20x.pm
--- wancfg_zaptel/A20x.pm	2007-06-06 14:44:41.000000000 -0400
+++ wancfg_zaptel_old/A20x.pm	2007-02-09 12:49:20.000000000 -0500
@@ -12,7 +12,6 @@
 		_card      => undef,		
 		_tdm_opermode => 'FCC',
 		_tdm_law => 'MULAW',
-		_rm_network_sync => 'NO',
 		_analog_modules => undef,
 	};			
 	bless $self, $class;
@@ -37,12 +36,6 @@
 				                        return $self->{_tdm_law};
 }
 
-sub rm_network_sync {
-	            my ( $self, $rm_network_sync ) = @_;
-		                    $self->{_rm_network_sync} = $rm_network_sync if defined($rm_network_sync);
-				                        return $self->{_rm_network_sync};
-}
-
 sub analog_modules {
 	            my ( $self, $analog_modules ) = @_;
 		                    $self->{_analog_modules} = $analog_modules if defined($analog_modules);
@@ -105,7 +98,6 @@
 	my $pci_bus = $self->card->pci_bus;
 	my $tdm_law = $self->tdm_law;
 	my $tdm_opermode = $self->tdm_opermode;
-	my $rm_network_sync = $self->rm_network_sync;
 	my $hwec_mode = $self->card->hwec_mode;
 
 	open(FH, $wanpipe_conf_template) or die "Can open $wanpipe_conf_template";
@@ -119,7 +111,6 @@
         $wp_file =~ s/SLOTNUM/$pci_slot/g;
         $wp_file =~ s/BUSNUM/$pci_bus/g;
         $wp_file =~ s/TDM_LAW/$tdm_law/g;
-	$wp_file =~ s/RMNETSYNC/$rm_network_sync/g;
         $wp_file =~ s/TDM_OPERMODE/$tdm_opermode/g;
         $wp_file =~ s/HWECMODE/$hwec_mode/g;
 	
Only in wancfg_zaptel_old: .config-zaptel.pl.swp
Only in wancfg_zaptel: diff
Common subdirectories: wancfg_zaptel/templates and wancfg_zaptel_old/templates
Common subdirectories: wancfg_zaptel/tmp_cfg and wancfg_zaptel_old/tmp_cfg
diff -u wancfg_zaptel/wancfg_zaptel.pl wancfg_zaptel_old/wancfg_zaptel.pl
--- wancfg_zaptel/wancfg_zaptel.pl	2007-06-07 14:23:55.000000000 -0400
+++ wancfg_zaptel_old/wancfg_zaptel.pl	2007-02-22 14:50:59.000000000 -0500
@@ -9,7 +9,6 @@
 #               as published by the Free Software Foundation; either version
 #               2 of the License, or (at your option) any later version.
 # ----------------------------------------------------------------------------
-# Jun 07,  2007  David Yat Sin  support for TE_REF_CLOCK and RM_NETWORK_SYNC 
 # Jan 15,  2007  David Yat Sin  support for non-trixbox installations. Major 
 #				changes to script.
 # Jan 8,   2007  David Yat Sin  script renamed to config-zaptel.pl
@@ -23,7 +22,7 @@
 system('clear');
 print "\n###################################################################";
 print "\n#         Sangoma Wanpipe/Zaptel Configuration Script             #";
-print "\n#                           v2.3                                  #";
+print "\n#                           v2.2                                  #";
 print "\n#                  Sangoma Technologies Inc.                      #";
 print "\n#                     Copyright(c) 2006.                          #";
 print "\n###################################################################\n\n";
@@ -54,10 +53,6 @@
 my $num_digital_devices=0;
 my $num_digital_devices_total=0;
 
-my $device_has_hwec=$FALSE;
-my $device_has_normal_clock=$FALSE;
-my @device_normal_clocks=("0");
-
 my $def_femedia='';
 my $def_feframe='';
 my $def_feclock='';
@@ -65,7 +60,6 @@
 my $def_switchtype='';
 my $def_zapata_context='';
 my $def_zapata_group='';
-my $def_te_ref_clock='';
 
 my $is_trixbox = $FALSE;
 my $config_zapata = $TRUE;
@@ -103,8 +97,6 @@
 config_digital();
 config_analog();
 
-
-
 if($devnum==1){
 	system('clear');
 	print "\n###################################################################";
@@ -243,7 +235,7 @@
 }
 
 sub unload_zap_modules{
-	my @modules_list = ("ztdummy","wctdm","wcfxo","wcte11xp","wct1xxp","wct4xxp","tor2","zttranscode","zaptel");
+	my @modules_list = ("ztdummy","wctdm","wcfxo","wcte11xp","wct1xxp","wct4xxp","tor2","zaptel");
 	foreach my $module (@modules_list) {
 		exec_command("modprobe -r $module");
 	}
@@ -277,45 +269,47 @@
 	close(FH);	
 }
 
-sub copy_config_files{
-	my @wanpipe_files = split / /, $startup_string; 	
-	exec_command("cp -f $current_dir/$cfg_dir/wanrouter.rc /etc/wanpipe");
-	foreach my $wanpipe_file (@wanpipe_files) {
-		exec_command("cp -f $current_dir/$cfg_dir/$wanpipe_file.conf /etc/wanpipe");
-	}
-}
 sub apply_changes{
+#	if ($is_trixbox==$FALSE){
+#		print "\nThe following lines will be used in your $zaptel_conf_file_t\n";
+#		print "\n-----------------------------------------------------------------\n";
+#		print "\n$zaptel_conf";
+#		print "\n-----------------------------------------------------------------\n";
+#		prompt_user("Press any key to continue");
+	
+#		if ($config_zapata==$TRUE){
+#	       		print "\nThe following lines will be used in your $zapata_conf_file_t\n";
+#			print "\n-----------------------------------------------------------------\n";
+#			print "\n$zapata_conf";
+#			print "\n-----------------------------------------------------------------\n";
+#			prompt_user("Press any key to continue");
+#		}
+#	}
 	my $asterisk_command='';
-	my $asterisk_restart=$FALSE;
 	my $res='';
 	system('clear');
 	print "\nZaptel and Wanpipe configuration complete: choose action\n";
-	$res=&prompt_user_list("Save cfg: Restart Asterisk & Wanpipe now",
-				"Save cfg: Restart Asterisk & Wanpipe when convenient",
-				"Save cfg: Stop Asterisk & Wanpipe now", 
-				"Save cfg: Stop Asterisk & Wanpipe when convenient",
-				"Do not save cfg: Exit",
-				"");
+	$res=&prompt_user_list("Save cfg: Restart Asterisk & Wanpipe now","Save cfg: Restart Asterisk & Wanpipe when convenient","Do not save cfg: Exit","");
 	if( $res =~ m/exit/){
 		print "No changes made to your configuration files\n";
 		exit 0;
-	}
-	if($res =~ m/now/){
+	}elsif($res =~ m/Restart/){
 		$asterisk_command='stop now';	
 	}else{
 		$asterisk_command='stop when convenient';
 	}
 
-	if( $res =~ m/Restart/){
-		$asterisk_restart=$TRUE;
-	}else{
-		$asterisk_restart=$FALSE;
-	}
+#	print "Your original configuration files have been saved to:\n";
+#	print "\t1. $zaptel_conf_file_t.bak \n";
+#	if ($config_zapata==$TRUE){
+#       		print "\t2. $zapata_conf_file_t.bak \n\n";
+#	}
 
 	if ($is_trixbox==$TRUE){
 		exec_command("amportal stop");
+		unload_zap_modules();
 	}else{
-		print "\nTrying to stop Asterisk...\n";	
+		print "\nStopping Asterisk...\n";	
 		exec_command("asterisk -rx \"$asterisk_command\"");
 	} 
 	print "\n\nStopping Wanpipe...\n";
@@ -330,7 +324,7 @@
        	gen_wanrouter_rc();
 
 	print "\nCopying new Wanpipe configuration files...\n";
-	copy_config_files();
+	exec_command("cp -f $current_dir/$cfg_dir/* /etc/wanpipe");
 	
 	print "\nCopying new Zaptel configuration file ($zaptel_conf_file_t)...\n";
 	exec_command("cp -f $zaptel_conf_file $zaptel_conf_file_t");
@@ -339,35 +333,33 @@
 		print "\nCopying new chan_zap configuration files ($zapata_conf_file_t)...\n";
 		exec_command("cp -f $zapata_conf_file $zapata_conf_file_t");
 	}
-	if( $asterisk_restart == $TRUE ){
-        	print "\nStarting Wanpipe...\n";
-		exec_command("wanrouter start");
-
-		if ( ! -e "/etc/wanpipe/scripts/start" & $is_trixbox==$FALSE ){ 
-       			print "Loading Zaptel...\n";	
-			sleep 2;
-			exec_command("ztcfg -v");   
-			print ("\nWould you like to execute \'ztcfg\' each time wanrouter starts?\n");
-			if (&prompt_user_list("YES","NO","") eq 'YES'){
-				exec_command("cp -f /etc/wanpipe/samples/wanpipe_zaptel_start /etc/wanpipe/scripts/start");	
-			}	 
-		}
-		if ($is_trixbox==$TRUE){
-			exec_command("ztcfg -v");   
-     			print "\nStarting Amportal...\n";
-			exec_command("amportal start");
-			sleep 2;
-		}elsif($config_zapata==$TRUE){
-     			print "\nStarting Asterisk...\n";
-			exec_command("asterisk");
-			sleep 2;
+        print "\nStarting Wanpipe...\n";
+	exec_command("wanrouter start");
+
+	if ( ! -e "/etc/wanpipe/scripts/start" & $is_trixbox==$FALSE){ 
+       		print "Loading Zaptel...\n";	
+		sleep 2;
+		exec_command("ztcfg -v");   
+		print ("\nWould you like to execute \'ztcfg\' each time wanrouter starts?\n");
+		if (&prompt_user_list("YES","NO","") eq 'YES'){
+			exec_command("cp -f /etc/wanpipe/samples/wanpipe_zaptel_start /etc/wanpipe/scripts/start");	
+			
+		}	 
+	}
+	if ($is_trixbox==$TRUE){
+     		print "\nStarting Amportal...\n";
+		exec_command("amportal start");
+		sleep 2;
+	}elsif($config_zapata==$TRUE){
+     		print "\nStarting Asterisk...\n";
+		exec_command("asterisk");
+		sleep 2;
 		
-			print "\nListing Asterisk channels...\n\n";
-			exec_command("asterisk -rx \"zap show channels\"");
-			print "\nType \"asterisk -r\" to connect to Asterisk console\n\n";
-		}else{
-        		print "\nProceed to your Asterisk chan_zap configuration (/etc/asterisk/zapata.conf)\n\n";
-		}
+		print "\nListing Asterisk channels...\n\n";
+		exec_command("asterisk -rx \"zap show channels\"");
+		print "\nType \"asterisk -r\" to connect to Asterisk console\n\n";
+	}else{
+        	print "\nProceed to your Asterisk chan_zap configuration (/etc/asterisk/zapata.conf)\n\n";
 	}
 	exit 0;
 }
@@ -427,7 +419,13 @@
        	close (FH);	
 			
 	
+#	print "\n\nGenerating debug tarball $debug_tarball \n";
 	exec_command("tar cvfz $debug_tarball $cfg_dir/* >/dev/null 2>/dev/null");
+
+#	print "\nEmail $debug_tarball to techdesk\@sangoma.com";
+#	print "\nwhen requesting support.\n";	
+#	prompt_user("Press any key to continue");
+	
 }
 
 sub config_analog{
@@ -436,6 +434,7 @@
 	print "------------------------------------\n";
 	print "Configuring analog cards [A200/A400]\n";
 	print "------------------------------------\n";
+#	prompt_user("Press any key to continue");
 	my $skip_card=$FALSE;
 	$zaptel_conf.="\n";
 	$zapata_conf.="\n";
@@ -470,30 +469,17 @@
 			       		} 
 				}
 				if ($skip_card==$FALSE){
-               				$a20x = eval {new A20x(); } or die ($@);
-					$a20x->card($card);
-					$card->first_chan($current_zap_channel);
-       					$current_zap_channel+=24;
-
-					if ( $device_has_hwec==$TRUE){
-						print "Will this A$1 to synchronize with an existing Sangoma T1/E1 card?\n";
-						print "\n WARNING: for hardware and firmware requirements, check:\n";
-						print "          http://wiki.sangoma.com/t1e1analogfaxing\n";
-						
-						if (&prompt_user_list(("YES","NO","")) eq 'NO'){
-							$a20x->rm_network_sync('NO');
-						} else {
-							$a20x->rm_network_sync('YES');
-						}
-					} 
-
 					print "A$1 configured on slot:$3 bus:$4 span:$devnum\n";
 					prompt_user("Press any key to continue");
 			 		$zaptel_conf.="#Sangoma A$1 [slot:$3 bus:$4 span:$devnum]\n";
 					$zapata_conf.=";Sangoma A$1 [slot:$3 bus:$4 span:$devnum]\n";
 					$startup_string.="wanpipe$devnum ";
 			
-	#				my $i;
+               				$a20x = eval {new A20x(); } or die ($@);
+					$a20x->card($card);
+					$card->first_chan($current_zap_channel);
+       					$current_zap_channel+=24;
+					my $i;
 					$a20x->gen_wanpipe_conf();
 					$devnum++;
 					$num_analog_devices++;
@@ -529,6 +515,7 @@
 	print "---------------------------------------------\n";
 	print "Configuring T1/E1 cards [A101/A102/A104/A108]\n";
 	print "---------------------------------------------\n";
+#	prompt_user("Press any key to continue");
 	
 	foreach my $dev (@hwprobe) {
 		if ( $dev =~ /A(\d+)(.*):.*SLOT=(\d+).*BUS=(\d+).*CPU=(\w+).*PORT=(\w+).*/){
@@ -573,14 +560,21 @@
 				system('clear');
 				if (($6 eq '1' || $6 eq 'PRI') && $5 eq 'A'){
                                		print "A$1 detected on slot:$3 bus:$4\n";
-					$device_has_normal_clock=$FALSE;
-					@device_normal_clocks = ("0");
+			#		prompt_user("Press any key to continue");
+			#		$def_femedia='';
+		#			$def_feframe='';
+		#			$def_feclock='';
+	#				$def_signalling='';
+#					$def_switchtype='';
+#					$def_zapata_context='';
+#					$def_zapata_group='';
 				}
 				system('clear');
 				my $msg ="Configuring port ".$port." on A".$card->card_model." slot:".$card->pci_slot." bus:".$card->pci_bus.".\n";
 				print "\n-----------------------------------------------------------\n";
 				print "$msg";
 				print "-----------------------------------------------------------\n";
+		#		prompt_user("Press any key to continue");
 					
 				printf ("\nSelect media type for A%s on port %s [slot:%s bus:%s span:$devnum]\n", $card->card_model, $port, $card->pci_slot, $card->pci_bus);
 				my @options = ("T1", "E1", "Unused","Exit");
@@ -593,15 +587,12 @@
 					}
 				}elsif ( $fe_media eq 'Unused'){
 					$def_femedia=$fe_media;	
+			#		system('clear');
 					my $msg= "A$1 on slot:$3 bus:$4 port:$port not configured\n";
 					print "$msg";
 					prompt_user("Press any key to continue");
 				}else{
-					if ($card->hwec_mode eq 'YES' && $device_has_hwec==$FALSE){
-						$device_has_hwec=$TRUE;
-					} 
-			       		
-					$def_femedia=$fe_media; 
+			       		$def_femedia=$fe_media; 
 					$startup_string.="wanpipe$devnum ";
 					my $a10x;
 		       	
@@ -635,33 +626,16 @@
 			      			$current_zap_channel+=31;
 					}
 					my @options = ("NORMAL", "MASTER");
-					printf ("Select clock for A%s on port %s [slot:%s bus:%s span:$devnum]\n", $card->card_model, $port, $card->pci_slot, $card->pci_bus);
+					printf ("Select clock for A%s on port %s \n", $card->card_model, $port);
 					$def_feclock=&prompt_user_list(@options, $def_feclock);
 					$a10x->fe_clock($def_feclock);
-
-					if ( $def_feclock eq 'NORMAL') {
-						$device_has_normal_clock=$TRUE;
-						 push(@device_normal_clocks, $a10x->fe_line);
-					} elsif ( $def_feclock eq 'MASTER' && $device_has_normal_clock == $TRUE ){
-						printf("Clock synchronisation options for %s on port %s [slot:%s bus:%s span:$devnum] \n", 
-								$card->card_model, 
-								$port, 
-								$card->pci_slot, 
-								$card->pci_bus);
-						printf(" Free run: Use internal oscillator on card [default] \n");
-        					printf(" Port N: Sync with clock from port N \n\n");
-						
-						printf("Select clock source %s on port %s [slot:%s bus:%s span:$devnum]\n", $card->card_model, $port, $card->pci_slot, $card->pci_bus);
-						$def_te_ref_clock=&get_te_ref_clock(@device_normal_clocks);
-						$a10x->te_ref_clock($def_te_ref_clock);
-					}
 			
 		     	   		@options = ("PRI CPE", "PRI NET", "E & M", "E & M Wink", "FXS - Loop Start", "FXS - Ground Start", "FXS - Kewl Start", "FX0 - Loop Start", "FX0 - Ground Start", "FX0 - Kewl Start");
 					printf ("Select signalling type for %s on port %s [slot:%s bus:%s span:$devnum]\n", $card->card_model, $port, $card->pci_slot, $card->pci_bus);
 				       	$def_signalling=&prompt_user_list(@options,$def_signalling); 
 					$a10x->signalling($def_signalling);
 
-					if ( $a10x->signalling eq 'PRI CPE' || $a10x->signalling eq 'PRI NET' ){
+					if ( $a10x->signalling eq 'PRI CPE' | $a10x->signalling eq 'PRI NET' ){
 						if ( $config_zapata==$TRUE){
 							printf ("Select switchtype for %s on port %s \n", $card->card_model, $port);
 							$a10x->pri_switchtype(get_pri_switchtype());
@@ -676,6 +650,7 @@
 					}
 					$devnum++;
 					$num_digital_devices++;
+			#		system('clear');
 					my $msg ="Port ".$port." on A".$card->card_model." configuration complete...\n";
 					print "$msg";
 					prompt_user("Press any key to continue");
@@ -700,6 +675,14 @@
 		       	if( $4 eq 'A' ){
                       		print "\n\nSangoma single/dual T1/E1 card detected on slot:$2 bus:$3\n";
 		      		print "Select configuration options:\n";
+		#		prompt_user("Press any key to continue");
+#				$def_femedia='';
+#				$def_feframe='';
+#				$def_feclock='';
+#				$def_signalling='';
+#				$def_switchtype='';
+#				$def_zapata_context='';
+#				$def_zapata_group='';
 		       		
 				$port=1;
 			}else{
@@ -769,33 +752,6 @@
 	close SCR;
 }
 
-
-sub get_te_ref_clock{
-	my @list_normal_clocks=@_;
-	my @f_list_normal_clocks;
-	my $f_port;
-	foreach my $port (@list_normal_clocks) {
-		if ($port eq '0'){
-			$f_port = "Free run";
-		} else {
-			$f_port = "Port ".$port;
-		}
-		push(@f_list_normal_clocks, $f_port);
-	}		
-
-	my $res = &prompt_user_list(@f_list_normal_clocks, "Free run");
-	my $i;
-	
-	for $i (0..$#f_list_normal_clocks){
-		if ( $res eq @f_list_normal_clocks[$i] ){
-			return @list_normal_clocks[$i];
-		}
-	}
-
-	print "Internal error: Invalid reference clock\n";
-	exit 1;
-
-}
 sub get_zapata_context{
 	my ($card_model,$card_port)=@_;
 	my $context='';
@@ -826,6 +782,10 @@
 		exit 1;
 	}
 	$def_zapata_context=$context;
+#	if($is_trixbox==$FALSE){
+#		print "\n Use \"[$context]\" in your /etc/asterisk/extensions.conf to";
+#		print "\n configure your dialplan for incoming calls on this port.\n";
+#	}
 	return $context;	
 }
 sub get_zapata_group{
@@ -856,6 +816,10 @@
 			$def_zapata_group=$group;
 		}      
 	}
+#	if($is_trixbox==$FALSE){
+#		print "\n Use \"exten=>s,1,Dial(Zap/g$group/\${EXTEN})\" in your";
+#		print "\n /etc/asterisk/extensions.conf to dial out on this port.\n";
+#	}
        
        	return $group;
 }
Only in wancfg_zaptel_old: .wancfg_zaptel.pl.swp
