[asterisk-commits] crichter: trunk r71500 - in /trunk: ./ channels/ channels/misdn/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 25 04:46:18 CDT 2007


Author: crichter
Date: Mon Jun 25 04:46:18 2007
New Revision: 71500

URL: http://svn.digium.com/view/asterisk?view=rev&rev=71500
Log:
Merged revisions 71214 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r71214 | crichter | 2007-06-23 00:44:42 +0200 (Sa, 23 Jun 2007) | 9 lines

Merged revisions 70341 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70341 | crichter | 2007-06-20 17:29:09 +0200 (Mi, 20 Jun 2007) | 1 line

fixed a bug that was introduced by copy and paste in the last commit ..bchannels weren't cleaned properly.
........

................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_misdn.c
    trunk/channels/misdn/isdn_lib.c
    trunk/channels/misdn/isdn_lib.h

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?view=diff&rev=71500&r1=71499&r2=71500
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Mon Jun 25 04:46:18 2007
@@ -1154,7 +1154,7 @@
 		}
 	}
 
-
+ 	misdn_dump_chanlist();
 	return 0;
 }
 

Modified: trunk/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.c?view=diff&rev=71500&r1=71499&r2=71500
==============================================================================
--- trunk/channels/misdn/isdn_lib.c (original)
+++ trunk/channels/misdn/isdn_lib.c Mon Jun 25 04:46:18 2007
@@ -424,12 +424,19 @@
 	int i;
 
 	for (i=0; i <= stack->b_num; i++) {
-		cb_log(6, stack->port, "Idx:%d stack->cchan:%d Chan:%d\n",i,stack->channels[i], i+1);
-	}
-}
-
-
-
+		cb_log(6, stack->port, "Idx:%d stack->cchan:%d in_use:%d Chan:%d\n",i,stack->channels[i], stack->bc[i].in_use, i+1);
+	}
+}
+
+
+void misdn_dump_chanlist()
+{
+	struct misdn_stack *stack=get_misdn_stack();
+	for ( ; stack; stack=stack->next) {
+		dump_chan_list(stack);
+	}
+
+}
 
 static int find_free_chan_in_stack(struct misdn_stack *stack, struct misdn_bchannel *bc, int channel, int dec)
 {
@@ -671,7 +678,6 @@
 	mISDN_write_frame(stack->midev, buff, bc->layer_id|FLG_MSG_TARGET|FLG_MSG_DOWN, MGR_DELLAYER | REQUEST, 0, 0, NULL, TIMEOUT_1SEC);
 	
 	bc->b_stid = 0;
-	bc->in_use = 0;
 	bc_state_change(bc, BCHAN_CLEANED);
 	
 	return ret;
@@ -689,6 +695,7 @@
 			empty_chan_in_stack(stack,i+1);
 			empty_bc(&stack->bc[i]);
 			clean_up_bc(&stack->bc[i]);
+			stack->bc[i].in_use = 0;
 		}
 		
 	} 
@@ -1607,7 +1614,8 @@
 				clean_up_bc(bc);
 
 				if (channel>0)
-					empty_chan_in_stack(stack,bc->channel);
+					empty_chan_in_stack(stack,channel);
+				bc->in_use=0;
 
 				dump_chan_list(stack);
 
@@ -1641,11 +1649,12 @@
 		return;
 	}
 	
-	if (bc->channel>0) {
+	if (bc->channel>0) 
 		empty_chan_in_stack(stack,bc->channel);
-	}
+	
 	empty_bc(bc);
 	clean_up_bc(bc);
+	bc->in_use=0;
 }
 
 
@@ -2061,7 +2070,7 @@
 					break;
 				case EVENT_RELEASE:
 				case EVENT_RELEASE_COMPLETE:
-				{
+					{
 					int channel=bc->channel;
 					int tmpcause=bc->cause;	
 			                empty_bc(bc);
@@ -2069,7 +2078,8 @@
 					clean_up_bc(bc);
 
 					if (channel>0)
-                        			empty_chan_in_stack(stack, bc->channel);
+                        			empty_chan_in_stack(stack,channel);
+					bc->in_use=0;
 					}
 					break;
 
@@ -2640,8 +2650,6 @@
 					bc->in_use=0;
 
 					cb_log(0, stack->port, "GOT IGNORE SETUP\n");
-
-					
 					break;
 				case RESPONSE_OK:
 					cb_log(4, stack->port, "GOT SETUP OK\n");
@@ -2669,8 +2677,9 @@
 						set_chan_in_stack(stack,bc->channel);
 				} else {
 					if (channel>0)
-						empty_chan_in_stack(stack,bc->channel);
+						empty_chan_in_stack(stack,channel);
 				}
+				bc->in_use=0;
 			}
 
 			cb_log(5, stack->port, "Freeing Msg on prim:%x \n",frm->prim);
@@ -3356,7 +3365,9 @@
 			clean_up_bc(bc);
 
 			if (channel>0)
-				empty_chan_in_stack(stack,bc->channel);
+				empty_chan_in_stack(stack,channel);
+
+			bc->in_use=0;	
 		}
 		
 	}
@@ -3401,6 +3412,8 @@
 			
 			if (channel>0)
 				empty_chan_in_stack(stack,channel);
+			
+			bc->in_use=0;
 		}
 		break;
     
@@ -3700,9 +3713,11 @@
 			if (stack->bc[cnt].channel == i) {
 				empty_bc(&stack->bc[cnt]);
 				clean_up_bc(&stack->bc[cnt]);
+				stack->bc[cnt].in_use=0;
 			}
 		}
 		empty_chan_in_stack(stack, i);
+
 			
 	}
 
@@ -4205,7 +4220,8 @@
 	if (bc->channel>0)
 		empty_chan_in_stack(stack, bc->channel);
 	empty_bc(bc);
-  
+ 	bc->in_use=0;
+
 	cb_event(EVENT_CLEANUP, bc, NULL); 
 }
 

Modified: trunk/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.h?view=diff&rev=71500&r1=71499&r2=71500
==============================================================================
--- trunk/channels/misdn/isdn_lib.h (original)
+++ trunk/channels/misdn/isdn_lib.h Mon Jun 25 04:46:18 2007
@@ -476,5 +476,6 @@
 char *bc_state2str(enum bchannel_state state);
 void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state);
 
+void misdn_dump_chanlist(void);
 
 #endif




More information about the asterisk-commits mailing list