Index: wancfg_zaptel.pl
===================================================================
--- wancfg_zaptel.pl	(revision 5905)
+++ wancfg_zaptel.pl	(working copy)
@@ -9,6 +9,9 @@
 #               as published by the Free Software Foundation; either version
 #               2 of the License, or (at your option) any later version.
 # ----------------------------------------------------------------------------
+# May 27   2008  2.14   Jignesh Patel   Added XMPT2 only option for SS7 
+# May 27   2008  2.14   Jignesh Patel   Updated ss7_a100x tempates for new XMPT2 interface
+# May 22   2008  2.13 	Jignesh Patel   Added confirmation /dev/zap/* loaded for hardhdlc test
 # Apr 28   2008  2.13   Jignesh Patel   Added TDM_OP_MODE for Analog and confirmation check
 # Mar 28   2008  2.12   Jignesh Patel 	Removed BRI master clock and update unload_zap
 # Jan 02   2008	 2.11  	David Yat Sin  	Support for per span configuration in silent mode
@@ -32,7 +35,7 @@
 system('clear');
 print "\n########################################################################";
 print "\n#    Sangoma Wanpipe:  Zaptel/SMG/TDMAPI/BOOT Configuration Script     #";
-print "\n#                             v2.13                                    #";
+print "\n#                             v2.14                                    #";
 print "\n#                     Sangoma Technologies Inc.                        #";
 print "\n#                        Copyright(c) 2008.                            #";
 print "\n########################################################################\n\n";
@@ -142,8 +145,8 @@
 my $def_hw_dtmf="YES";
 my $def_tdm_law='';
 my $def_tdm_opermode="FCC";
+my $def_is_ss7_xmpt2_only='';
 
-
 my @silent_femedias;
 my @silent_feframes;
 my @silent_felcodes;
@@ -201,6 +204,7 @@
 my $tdm_api_span_num=0;
 my $zaptel_installed=$FALSE;
 my $modprobe_list=`$module_list`;
+my $is_ss7_xmpt2_only = $FALSE;
 
 
 read_args();
@@ -275,8 +279,29 @@
 
 
 sub set_zaptel_hwhdlc{
+	print "Checking for native zaptel hardhdlc support...";
+        my $cnt = 0;
+        while ($cnt++ < 30) {
+             if ((system("ls /dev/zap* > /dev/null 2>  /dev/null")) == 0) {
+	                   goto wait_done;
+                } else {
+                        print "." ;
+                        sleep(1);
+                }
+        }
+	print "Error";
+	print "\n\n No /dev/zap* Found on the system \n";
+	printf "     Contact Sangoma Support\n";
+	print " Send e-mail to techdesk\@sangoma\.com \n\n";
+	exit 1;
+wait_done:
+
 	if ((system("ztcfg -t -c $current_dir/templates/zaptel.conf_test > /dev/null 2>/dev/null")==0)){
 		$dchan_str="hardhdlc";
+		 print "Yes \n\n";
+
+        } else {
+                print "No \n\n";
 	}
 }
 
@@ -1008,7 +1033,7 @@
 		print("  $num_bri_devices_total ISDN BRI port(s) detected, $num_bri_devices configured\n");
 		print("  $num_analog_devices_total analog card(s) detected, $num_analog_devices configured\n");
 		
-		print "\nConfigurator has created the following files:\n";
+		print "\nConfigurator will create the following files:\n";
 		print "\t1. Wanpipe config files in $wanpipe_conf_dir\n";
 		$file_list++;
 		
@@ -1047,8 +1072,8 @@
 	}
 }
 sub confirm_conf(){
-	print "Would you like to confirm above configuration?\n";
-	if(&prompt_user_list("No - exit", "YES", "") eq 'YES'){
+	print "Configuration Complete! Please select following:\n";
+	if(&prompt_user_list("YES - Continue", "NO - Exit" ,"") =~ m/YES/){
 		return $?;
 	} else {
 		print "No changes made to your configuration files\n";
@@ -2230,6 +2255,17 @@
 
 				if( $a10x->signalling eq 'SS7 - Sangoma Signal Media Gateway' ){
 					$a10x->ss7_option(1); 
+					my @options="";	
+					print("Select an option below to configure SS7 signalling channels:\n");
+					my @options =("Configure SS7 XMPT2 Only", 
+						      "Configure SS7 XMPT2 + Voice");
+					$def_is_ss7_xmpt2_only = &prompt_user_list(@options, "$def_is_ss7_xmpt2_only");
+					
+					if($def_is_ss7_xmpt2_only=~ m/Only/){
+						$is_ss7_xmpt2_only = $TRUE;
+					}else{
+						$is_ss7_xmpt2_only = $FALSE;
+					}
 					print("Choose an option below to configure SS7 signalling channels:\n");
 					my @options =("Configure individual signalling channels(e.g #1,#10)", 
 						      "Configure consecutive signalling channels(e.g   #1-#16)");
@@ -2292,19 +2328,21 @@
 					print("\nYou configured the following SS7 signalling channels: @ss7_sorted\n");
 					my $ss7_voicechans = gen_ss7_voicechans(@ss7_sorted,$max_chans);
 					$ss7_tdmvoicechans = $ss7_voicechans;
+					 if ($is_ss7_xmpt2_only ==$FALSE){
 
-					if ($ss7_voicechans =~ m/(\d+)/){
-						$a10x->ss7_tdminterface($1);
+						if ($ss7_voicechans =~ m/(\d+)/){
+							$a10x->ss7_tdminterface($1);
+						}
+		
+						$a10x->ss7_tdmchan($ss7_voicechans);
+	
+						$num_ss7_config++;
+						$card->tdmv_span_no($current_tdmapi_span);
+	
+						#wanrouter start/stop for signalling span is controlled by ss7boxd
+						#$startup_string.="wanpipe$devnum "; 
+						$current_tdmapi_span++;
 					}
-	
-					$a10x->ss7_tdmchan($ss7_voicechans);
-
-					$num_ss7_config++;
-					$card->tdmv_span_no($current_tdmapi_span);
-
-					#wanrouter start/stop for signalling span is controlled by ss7boxd
-					#$startup_string.="wanpipe$devnum "; 
-					$current_tdmapi_span++;
 				}elsif ( $a10x->signalling eq 'No Signaling (Voice Only)'){
 					$a10x->ss7_option(2);
 					$num_ss7_config++;   
