[asterisk-commits] branch crichter/0.3.0 r37322 - in /team/crichter/0.3.0/channels: ./ misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jul 10 04:03:27 MST 2006


Author: crichter
Date: Mon Jul 10 06:03:27 2006
New Revision: 37322

URL: http://svn.digium.com/view/asterisk?rev=37322&view=rev
Log:
removed unnecessary locking, which might have created deadlocks. removed find_chan_by_l3id, since the l3id is not unique over all ports. removed automatic nt_stack reinitialization, since this creates segfaults.

Modified:
    team/crichter/0.3.0/channels/chan_misdn.c
    team/crichter/0.3.0/channels/misdn/isdn_lib.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=37322&r1=37321&r2=37322&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Mon Jul 10 06:03:27 2006
@@ -61,12 +61,6 @@
 
 #include <chan_misdn_config.h>
 #include <isdn_lib.h>
-
-ast_mutex_t release_lock_mutex;
-
-#define release_lock ast_mutex_lock(&release_lock_mutex)
-#define release_unlock ast_mutex_unlock(&release_lock_mutex)
-
 
 char global_tracefile[BUFFERSIZE+1];
 
@@ -1909,21 +1903,16 @@
 	
 	if (!ast || ! (p=MISDN_ASTERISK_TECH_PVT(ast) ) ) return -1;
 	
-	release_lock;
-
-	
 	ast_log(LOG_DEBUG, "misdn_hangup(%s)\n", ast->name);
 	
 	if (!p) {
 		chan_misdn_log(3, 0, "misdn_hangup called, without chan_list obj.\n");
-		release_unlock;
 		return 0 ;
 	}
 	
 	bc=p->bc;
 
 	if (!bc) {
-		release_unlock;
 		ast_log(LOG_WARNING,"Hangup with private but no bc ?\n");
 		return 0;
 	}
@@ -1937,7 +1926,6 @@
 	if (ast->_state == AST_STATE_RESERVED) {
 		/* between request and call */
 		MISDN_ASTERISK_TECH_PVT(ast)=NULL;
-		release_unlock;
 		
 		cl_dequeue_chan(&cl_te, p);
 		free(p);
@@ -1951,8 +1939,6 @@
 	if (!p->bc->nt) 
 		stop_bc_tones(p);
 
-	
-	release_unlock;
 	
 	{
 		const char *varcause=NULL;
@@ -2729,18 +2715,6 @@
 }
 
 
-static struct chan_list *find_chan_by_l3id(struct chan_list *list, unsigned long l3id)
-{
-	struct chan_list *help=list;
-	for (;help; help=help->next) {
-		if (help->l3id == l3id ) return help;
-	}
-  
-	chan_misdn_log(6, list? (list->bc? list->bc->port : 0) : 0, "$$$ find_chan: No channel found with l3id:%x\n",l3id);
-  
-	return NULL;
-}
-
 static struct chan_list *find_chan_by_bc(struct chan_list *list, struct misdn_bchannel *bc)
 {
 	struct chan_list *help=list;
@@ -2883,17 +2857,14 @@
 	struct ast_channel *ast=NULL;
 	{
 		struct chan_list *ch=find_chan_by_bc(cl_te, bc);
-		if (!ch) ch=find_chan_by_l3id (cl_te, bc->l3_id);
 		if (!ch)  {
 			chan_misdn_log(0, bc->port, "release_chan: Ch not found!\n");
 			return;
 		}
 		
-		release_lock;
 		if (ch->ast) {
 			ast=ch->ast;
 		} 
-		release_unlock;
 		
 		chan_misdn_log(1, bc->port, "release_chan: bc with l3id: %x\n",bc->l3_id);
 		
@@ -3092,9 +3063,6 @@
 cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
 {
 	struct chan_list *ch=find_chan_by_bc(cl_te, bc);
-	
-	if (!ch)
-		ch=find_chan_by_l3id(cl_te, bc->l3_id);
 	
 	if (event != EVENT_BCHAN_DATA && event != EVENT_TONE_GENERATE) { /*  Debug Only Non-Bchan */
 		chan_misdn_log(1, bc->port, "I IND :%s oad:%s dad:%s pid:%d state:%s\n", manager_isdn_get_info(event), bc->oad, bc->dad, bc->pid, ch?misdn_get_ch_state(ch):"none");
@@ -3954,8 +3922,6 @@
 	}
 
 	ast_mutex_init(&cl_te_lock);
-	ast_mutex_init(&release_lock_mutex);
-
 
 	misdn_cfg_update_ptp();
 	misdn_cfg_get_ports_string(ports);

Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.c?rev=37322&r1=37321&r2=37322&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Mon Jul 10 06:03:27 2006
@@ -1926,7 +1926,9 @@
 				if (stack->l2upcnt>3) {
 					cb_log(-1 , stack->port, "!!! Could not Get the L2 up after 3 Attemps!!!\n");
 				}  else {
+#if 0
 					if (stack->nt) misdn_lib_reinit_nt_stack(stack->port);
+#endif
 					misdn_lib_get_l2_up(stack);
 					stack->l2upcnt++;
 				}



More information about the asterisk-commits mailing list