[asterisk-commits] branch crichter/0.3.0 r36940 - /team/crichter/0.3.0/channels/chan_misdn.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jul 4 10:03:00 MST 2006


Author: crichter
Date: Tue Jul  4 12:02:59 2006
New Revision: 36940

URL: http://svn.digium.com/view/asterisk?rev=36940&view=rev
Log:
removed the reloading of the ntdebug stuff, since this is a bit buggy, we only set it when loading chan_misdn for now. fixed a litle state problem when receiving RELEASE_COMPLETE. also we may only play tones to a NT when the extension does not match and such cases.

Modified:
    team/crichter/0.3.0/channels/chan_misdn.c

Modified: team/crichter/0.3.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn.c?rev=36940&r1=36939&r2=36940&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Tue Jul  4 12:02:59 2006
@@ -678,14 +678,6 @@
 		misdn_debug[i] = cfg_debug;
 		misdn_debug_only[i] = 0;
 	}
-
-	int ntflags=0;
-	char ntfile[BUFFERSIZE+1];
-
-	misdn_cfg_get( 0, MISDN_GEN_NTDEBUGFLAGS, &ntflags, sizeof(int));
-	misdn_cfg_get( 0, MISDN_GEN_NTDEBUGFILE, &ntfile, BUFFERSIZE);
-
-	misdn_lib_nt_debug_init(ntflags,ntfile);
 }
 
 static int misdn_reload (int fd, int argc, char *argv[])
@@ -3232,7 +3224,8 @@
 			if(!ast_canmatch_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
 
 				chan_misdn_log(-1, bc->port, "Extension can never match, so disconnecting\n");
-				tone_indicate(ch,TONE_BUSY);
+				if (bc->nt)
+					tone_indicate(ch,TONE_BUSY);
 				ch->state=MISDN_EXTCANTMATCH;
 				bc->out_cause=1;
 
@@ -3248,7 +3241,7 @@
 				if (ast_pbx_start(ch->ast)<0) {
 
 					chan_misdn_log(-1, bc->port, "ast_pbx_start returned < 0 in INFO\n");
-					tone_indicate(ch,TONE_BUSY);
+				 	if (bc->nt) tone_indicate(ch,TONE_BUSY);
 
 					misdn_lib_send_event(bc, EVENT_DISCONNECT );
 				}
@@ -3410,7 +3403,8 @@
 			
 			chan_misdn_log(-1, bc->port, "Extension can never match, so disconnecting\n");
 
-			tone_indicate(ch,TONE_BUSY);
+			if (bc->nt)
+				tone_indicate(ch,TONE_BUSY);
 			ch->state=MISDN_EXTCANTMATCH;
 			bc->out_cause=1;
 
@@ -3437,11 +3431,11 @@
 
 				chan_misdn_log(-1, bc->port, "ast_pbx_start returned <0 in SETUP\n");
 				chan=NULL;
-				tone_indicate(ch,TONE_BUSY);
-
-				if (bc->nt)
+
+				if (bc->nt) {
+					tone_indicate(ch,TONE_BUSY);
 					misdn_lib_send_event(bc, EVENT_RELEASE_COMPLETE );
-				else
+				} else
 					misdn_lib_send_event(bc, EVENT_RELEASE);
 			}
 		} else {
@@ -3671,9 +3665,9 @@
 		break;
 	case EVENT_RELEASE_COMPLETE:
 	{
-		ch->state=MISDN_CLEANING;
 		stop_bc_tones(ch);
 		release_chan(bc);
+		ch->state=MISDN_CLEANING;
 	}
 	break;
 
@@ -3965,6 +3959,15 @@
 		};
 		if (misdn_lib_init(ports, &iface, NULL))
 			chan_misdn_log(0, 0, "No te ports initialized\n");
+	
+		int ntflags=0;
+		char ntfile[BUFFERSIZE+1];
+
+		misdn_cfg_get( 0, MISDN_GEN_NTDEBUGFLAGS, &ntflags, sizeof(int));
+		misdn_cfg_get( 0, MISDN_GEN_NTDEBUGFILE, &ntfile, BUFFERSIZE);
+
+		misdn_lib_nt_debug_init(ntflags,ntfile);
+
 	}
 
 
@@ -4025,8 +4028,6 @@
 
 	misdn_cfg_get( 0, MISDN_GEN_TRACEFILE, global_tracefile, BUFFERSIZE);
 
-	reload_config();
-	
 	chan_misdn_log(0, 0, "-- mISDN Channel Driver Registred -- (BE AWARE THIS DRIVER IS EXPERIMENTAL!)\n");
 
 	return 0;



More information about the asterisk-commits mailing list