[asterisk-commits] trunk r36941 - /trunk/channels/chan_misdn.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jul 4 10:04:22 MST 2006


Author: crichter
Date: Tue Jul  4 12:04:21 2006
New Revision: 36941

URL: http://svn.digium.com/view/asterisk?rev=36941&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:
    trunk/channels/chan_misdn.c

Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?rev=36941&r1=36940&r2=36941&view=diff
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Tue Jul  4 12:04:21 2006
@@ -743,14 +743,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[])
@@ -3431,7 +3423,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;
 
@@ -3447,7 +3440,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 );
 				}
@@ -3617,7 +3610,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;
 
@@ -3644,11 +3638,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 {
@@ -3882,9 +3876,9 @@
 		break;
 	case EVENT_RELEASE_COMPLETE:
 	{
-		ch->state=MISDN_CLEANING;
 		stop_bc_tones(ch);
 		release_chan(bc);
+		ch->state=MISDN_CLEANING;
 	}
 	break;
 
@@ -4236,11 +4230,16 @@
 		
 		if (misdn_lib_init(ports, &iface, NULL))
 			chan_misdn_log(0, 0, "No te ports initialized\n");
-	}
-
-
-
-	reload_config();
+	
+		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);
+
+	}
 
 	{
 		if (ast_channel_register(&misdn_tech)) {



More information about the asterisk-commits mailing list