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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 7 02:51:11 MST 2007


Author: crichter
Date: Wed Feb  7 03:51:06 2007
New Revision: 53334

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

................
r53324 | crichter | 2007-02-07 10:22:44 +0100 (Mi, 07 Feb 2007) | 9 lines

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

........
r52843 | crichter | 2007-01-30 15:38:08 +0100 (Di, 30 Jan 2007) | 1 line

fixed some possible segfaults. also fixed an very important bug which occurs on high load (when calls are very fast generated)
........

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

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

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=53334&r1=53333&r2=53334
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Wed Feb  7 03:51:06 2007
@@ -4145,6 +4145,8 @@
 				strncat(bc->dad,bc->infos_pending, l - strlen(bc->dad));
 				bc->dad[l-1] = 0;
 			}	
+		
+			if (!ch->ast) break;
 			{
 				int l = sizeof(ch->ast->exten);
 				strncpy(ch->ast->exten, bc->dad, l);
@@ -4171,10 +4173,16 @@
 
 		ch->state = MISDN_PROCEEDING;
 		
+		if (!ch->ast) break;
+
 		ast_queue_control(ch->ast, AST_CONTROL_PROCEEDING);
 	}
 	break;
 	case EVENT_PROGRESS:
+
+		if (bc->channel) 
+			update_name(ch->ast,bc->port,bc->channel);
+
 		if (!bc->nt ) {
 			if ( misdn_cap_is_speech(bc->capability) &&
 			     misdn_inband_avail(bc)
@@ -4182,9 +4190,10 @@
 				start_bc_tones(ch);
 			}
 			
+			ch->state=MISDN_PROGRESS;
+
+			if (!ch->ast) break;
 			ast_queue_control(ch->ast, AST_CONTROL_PROGRESS);
-			
-			ch->state=MISDN_PROGRESS;
 		}
 		break;
 		
@@ -4193,6 +4202,8 @@
 	{
 		ch->state = MISDN_ALERTING;
 		
+		if (!ch->ast) break;
+
 		ast_queue_control(ch->ast, AST_CONTROL_RINGING);
 		ast_setstate(ch->ast, AST_STATE_RINGING);
 		
@@ -4215,7 +4226,9 @@
 	{
 		/*we answer when we've got our very new L3 ID from the NT stack */
 		misdn_lib_send_event(bc,EVENT_CONNECT_ACKNOWLEDGE);
-	
+
+		if (!ch->ast) break;
+
 		struct ast_channel *bridged=AST_BRIDGED_P(ch->ast);
 		stop_indicate(ch);
 
@@ -4238,8 +4251,10 @@
 		
 		start_bc_tones(ch);
 		
-		
 		ch->state = MISDN_CONNECTED;
+		
+		if (!ch->ast) break;
+
 		ast_queue_control(ch->ast, AST_CONTROL_ANSWER);
 	}
 	break;
@@ -4247,7 +4262,7 @@
 	/*we might not have an ch->ast ptr here anymore*/
 	if (ch) {
 		struct chan_list *holded_ch=find_holded(cl_te, bc);
-	
+		
 		chan_misdn_log(3,bc->port," --> org:%d nt:%d, inbandavail:%d state:%d\n", ch->orginator, bc->nt, misdn_inband_avail(bc), ch->state);
 		if ( ch->orginator==ORG_AST && !bc->nt && misdn_inband_avail(bc) && ch->state != MISDN_CONNECTED) {
 			/* If there's inband information available (e.g. a
@@ -4259,6 +4274,12 @@
 		
 			ch->state=MISDN_DISCONNECTED;
 			start_bc_tones(ch);
+
+			if (ch->ast) {
+				ch->ast->hangupcause=bc->cause;
+				ast_queue_control(ch->ast, AST_CONTROL_BUSY);
+			}
+			ch->need_busy=0;
 			break;
 		}
 		
@@ -4374,7 +4395,8 @@
 			frame.src = NULL;
 			frame.data = bc->bframe ;
 			
-			ast_queue_frame(ch->ast,&frame);
+			if (ch->ast) 
+				ast_queue_frame(ch->ast,&frame);
 		} else {
 			fd_set wrfs;
 			struct timeval tv;

Modified: trunk/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.c?view=diff&rev=53334&r1=53333&r2=53334
==============================================================================
--- trunk/channels/misdn/isdn_lib.c (original)
+++ trunk/channels/misdn/isdn_lib.c Wed Feb  7 03:51:06 2007
@@ -2859,22 +2859,11 @@
 {
 	msg_t *msg=alloc_msg(MAX_MSG_SIZE);
 	int r;
-/*	fd_set rdfs; */
 
 	if (!msg) {
 		cb_log(0, 0, "fetch_msg: alloc msg failed !!");
 		return NULL;
 	}
-
-#if 0
-	FD_ZERO(&rdfs);
-	FD_SET(midev,&rdfs);
-  
-	mISDN_select(FD_SETSIZE, &rdfs, NULL, NULL, NULL);
-	//select(FD_SETSIZE, &rdfs, NULL, NULL, NULL);
-  
-	if (FD_ISSET(midev, &rdfs)) {
-#endif
 
 	AGAIN:
 		r=mISDN_read(midev,msg->data,MAX_MSG_SIZE, TIMEOUT_10SEC);
@@ -2897,15 +2886,11 @@
 			cb_log(0,0,"mISDN_read returned :%d error:%s (%d)\n",r,strerror(errno),errno); 
 		}
 
+#if 0
+               if  (!(frm->prim == (DL_DATA|INDICATION) )|| (frm->prim == (PH_DATA|INDICATION)))
+                       cb_log(0,0,"prim: %x dinfo:%x addr:%x msglen:%d frm->len:%d\n",frm->prim, frm->dinfo, frm->addr, msg->len,frm->len );
+#endif
 		return msg;
-
-#if 0
-	} else {
-		printf ("Select timeout\n");
-	}
-#endif
-  
-	return NULL;
 }
 
 void misdn_lib_isdn_l1watcher(int port)
@@ -3914,8 +3899,6 @@
 void manager_bchannel_activate(struct misdn_bchannel *bc)
 {
 	char buf[128];
-	iframe_t *ifrm;
-	int ret;
 
 	struct misdn_stack *stack=get_stack_by_bc(bc);
 
@@ -3931,19 +3914,7 @@
 	
 	mISDN_write_frame(stack->midev, buf, bc->addr | FLG_MSG_DOWN,  DL_ESTABLISH | REQUEST, 0,0, NULL, TIMEOUT_1SEC);
 
-	ret=mISDN_read(stack->midev,buf,128,TIMEOUT_10SEC);
-
-	ifrm=(iframe_t*)buf;
-	
-	if (ret>0) {
-		if (ifrm->prim== (DL_ESTABLISH|CONFIRM)) {
-			cb_log(2,stack->port,"bchan: DL_ESTABLISH|CNF\n");
-		}
-	}
-	
-	
 	return ;
-  
 }
 
 
@@ -3976,8 +3947,6 @@
 	dact.len = 0;
 	char buf[128];	
 	mISDN_write_frame(stack->midev, buf, bc->addr | FLG_MSG_DOWN, DL_RELEASE|REQUEST,0,0,NULL, TIMEOUT_1SEC);
-
-	mISDN_read(stack->midev, buf, 128, TIMEOUT_1SEC);
 
 	clear_ibuffer(bc->astbuf);
 	



More information about the asterisk-commits mailing list