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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Oct 27 04:18:34 MST 2006


Author: crichter
Date: Fri Oct 27 06:18:32 2006
New Revision: 46354

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

................
r46351 | crichter | 2006-10-27 11:49:20 +0200 (Fr, 27 Okt 2006) | 9 lines

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

........
r46176 | crichter | 2006-10-25 10:41:59 +0200 (Mi, 25 Okt 2006) | 1 line

added nttimeout option to configure wether we disconnect calls on NT timeouts or not during an overlapdial session
........

................
r46352 | crichter | 2006-10-27 11:58:44 +0200 (Fr, 27 Okt 2006) | 1 line

fixed not compile issue, which was just introduced
................
r46353 | crichter | 2006-10-27 12:03:23 +0200 (Fr, 27 Okt 2006) | 9 lines

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

........
r46350 | crichter | 2006-10-27 11:24:01 +0200 (Fr, 27 Okt 2006) | 1 line

fixed a bug which caused chan_misdn to try to allocate 2 times the same channel on high load, which then caused instability of mISDN. removed a useless function from isdn_lib.c
........

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

Modified:
    trunk/   (props changed)
    trunk/channels/chan_misdn.c
    trunk/channels/misdn/chan_misdn_config.h
    trunk/channels/misdn/isdn_lib.c
    trunk/channels/misdn/isdn_lib.h
    trunk/channels/misdn/isdn_msg_parser.c
    trunk/channels/misdn_config.c
    trunk/configs/misdn.conf.sample

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?rev=46354&r1=46353&r2=46354&view=diff
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Fri Oct 27 06:18:32 2006
@@ -199,6 +199,9 @@
 	int dropped_frame_cnt;
 
 	int far_alerting;
+
+	int nttimeout;
+
 	int other_pid;
 	struct chan_list *other_ch;
 
@@ -1650,6 +1653,7 @@
 	misdn_cfg_get( port, MISDN_CFG_SENDDTMF, &bc->send_dtmf, sizeof(int));
 
 	misdn_cfg_get( port, MISDN_CFG_NEED_MORE_INFOS, &bc->need_more_infos, sizeof(int));
+	misdn_cfg_get( port, MISDN_CFG_NTTIMEOUT, &ch->nttimeout, sizeof(int));
 	
 	misdn_cfg_get( port, MISDN_CFG_FAR_ALERTING, &ch->far_alerting, sizeof(int));
 
@@ -2741,11 +2745,14 @@
 			*rc=who;
 			break;
 		}
-		
+	
+#if 0
 		if (f->frametype == AST_FRAME_VOICE) {
-			chan_misdn_log(1,0,"Got Voice frame in Bridged state..\n");
+			chan_misdn_log(1, ch1->bc->port, "I SEND: Splitting conference with Number:%d\n", ch1->bc->pid +1);
+	
 			continue;
 		}
+#endif
 
 		if (who == c0) {
 			ast_write(c1,f);
@@ -4264,6 +4271,7 @@
 			ch->state=MISDN_CLEANING;
 	}
 	break;
+	case EVENT_BCHAN_ERROR:
 	case EVENT_CLEANUP:
 	{
 		stop_bc_tones(ch);
@@ -4375,9 +4383,11 @@
 			chan_misdn_log(1,bc->port,"--> state: %s\n",misdn_get_ch_state(ch));
 
 		switch (ch->state) {
-			case MISDN_CALLING:
 			case MISDN_DIALING:
 			case MISDN_PROGRESS:
+				if (bc->nt && !ch->nttimeout) break;
+			
+			case MISDN_CALLING:
 			case MISDN_ALERTING:
 			case MISDN_PROCEEDING:
 			case MISDN_CALLING_ACKNOWLEDGE:

Modified: trunk/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/chan_misdn_config.h?rev=46354&r1=46353&r2=46354&view=diff
==============================================================================
--- trunk/channels/misdn/chan_misdn_config.h (original)
+++ trunk/channels/misdn/chan_misdn_config.h Fri Oct 27 06:18:32 2006
@@ -66,6 +66,7 @@
 	MISDN_CFG_BNEC_ADAPT,
 #endif
 	MISDN_CFG_NEED_MORE_INFOS,     /* bool */
+	MISDN_CFG_NTTIMEOUT,     /* bool */
 	MISDN_CFG_JITTERBUFFER,              /* int */
 	MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD,              /* int */
 	MISDN_CFG_CALLGROUP,           /* ast_group_t */

Modified: trunk/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.c?rev=46354&r1=46353&r2=46354&view=diff
==============================================================================
--- trunk/channels/misdn/isdn_lib.c (original)
+++ trunk/channels/misdn/isdn_lib.c Fri Oct 27 06:18:32 2006
@@ -649,16 +649,11 @@
 	
 	cb_log(2, stack->port, "$$$ Cleaning up bc with stid :%x pid:%d\n", bc->b_stid, bc->pid);
 	
+	manager_ec_disable(bc);
+
 	manager_bchannel_deactivate(bc);
 
-
-	manager_ec_disable(bc);
-
-
 	mISDN_write_frame(stack->midev, buff, bc->layer_id|FLG_MSG_TARGET|FLG_MSG_DOWN, MGR_DELLAYER | REQUEST, 0, 0, NULL, TIMEOUT_1SEC);
-	
-	/*mISDN_clear_stack(stack->midev, bc->b_stid);*/
-
 	
 	bc->b_stid = 0;
 	bc_state_change(bc, BCHAN_CLEANED);
@@ -1032,6 +1027,7 @@
 		mISDN_write_frame(midev, buff, bc->layer_id, MGR_DELLAYER | REQUEST, 0, 0, NULL, TIMEOUT_1SEC);
 		
 		bc_state_change(bc,BCHAN_ERROR);
+		cb_event(EVENT_BCHAN_ERROR, bc, glob_mgr->user_data);
 		return(-EINVAL);
 	}
 
@@ -1042,6 +1038,7 @@
 		mISDN_write_frame(midev, buff, bc->layer_id, MGR_DELLAYER | REQUEST, 0, 0, NULL, TIMEOUT_1SEC);
 		
 		bc_state_change(bc,BCHAN_ERROR);
+		cb_event(EVENT_BCHAN_ERROR, bc, glob_mgr->user_data);
 		return(-EINVAL);
 	}
 
@@ -1054,6 +1051,8 @@
 		mISDN_write_frame(midev, buff, bc->layer_id, MGR_DELLAYER | REQUEST, 0, 0, NULL, TIMEOUT_1SEC);
 		
 		bc_state_change(bc,BCHAN_ERROR);
+		cb_event(EVENT_BCHAN_ERROR, bc, glob_mgr->user_data);
+		return (-EINVAL);
 	}
 
 	manager_bchannel_activate(bc);
@@ -1494,7 +1493,7 @@
 		case EVENT_SETUP_ACKNOWLEDGE:
 
 		setup_bc(bc);
-		
+
 		case EVENT_SETUP:
 			
 		{
@@ -1538,22 +1537,6 @@
 	return 0;
 }
 
-static int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
-{
-  
-	struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0, 1);
-	
-	
-	if (!bc) {
-		cb_log(0, stack->port, " --> !! lib: No free channel!\n");
-		return -1;
-	}
-  
-	cb_log(7, stack->port, " --> new_process: New L3Id: %x\n",frm->dinfo);
-	bc->l3_id=frm->dinfo;
-	return 0;
-}
-
 static int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
 {
 	if (!stack) return -1;
@@ -1561,9 +1544,15 @@
 	switch (frm->prim) {
 	case CC_NEW_CR|INDICATION:
 		cb_log(7, stack->port, " --> lib: NEW_CR Ind with l3id:%x on this port.\n",frm->dinfo);
-		if (handle_new_process(stack, frm) <0) {
+
+		struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0, 1);
+		if (!bc) {
+			cb_log(0, stack->port, " --> !! lib: No free channel!\n");
 			return -1;
 		}
+  
+		cb_log(7, stack->port, " --> new_process: New L3Id: %x\n",frm->dinfo);
+		bc->l3_id=frm->dinfo;
 		return 1;
 	case CC_NEW_CR|CONFIRM:
 		return 1;
@@ -1796,18 +1785,26 @@
       
 		case CC_SETUP|INDICATION:
 		{
-			iframe_t frm; /* fake te frm to add callref to global callreflist */
-			frm.dinfo = hh->dinfo;
-			frm.addr=stack->upper_id;
-			frm.prim = CC_NEW_CR|INDICATION;
-			
-			if (handle_cr(stack, &frm)< 0) {
+			struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0, 1);
+			if (!bc) 
+			ERR_NO_CHANNEL:
+			{
 				msg_t *dmsg;
 				cb_log(4, stack->port, "Patch from MEIDANIS:Sending RELEASE_COMPLETE %x (No free Chan for you..)\n", hh->dinfo);
 				dmsg = create_l3msg(CC_RELEASE_COMPLETE | REQUEST,MT_RELEASE_COMPLETE, hh->dinfo,sizeof(RELEASE_COMPLETE_t), 1);
 				stack->nst.manager_l3(&stack->nst, dmsg);
 				free_msg(msg);
 				return 0;
+			}
+  
+			cb_log(7, stack->port, " --> new_process: New L3Id: %x\n",hh->dinfo);
+			bc->l3_id=hh->dinfo;
+
+			if (bc->channel<=0) {
+				bc->channel=find_free_chan_in_stack(stack,0,0);
+
+				if (bc->channel<=0)
+					goto ERR_NO_CHANNEL;
 			}
 		}
 		break;

Modified: trunk/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.h?rev=46354&r1=46353&r2=46354&view=diff
==============================================================================
--- trunk/channels/misdn/isdn_lib.h (original)
+++ trunk/channels/misdn/isdn_lib.h Fri Oct 27 06:18:32 2006
@@ -114,6 +114,7 @@
 	EVENT_TONE_GENERATE,
 	EVENT_BCHAN_DATA,
 	EVENT_BCHAN_ACTIVATED,
+	EVENT_BCHAN_ERROR,
 	EVENT_CLEANUP,
 	EVENT_PROCEEDING,
 	EVENT_PROGRESS,

Modified: trunk/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_msg_parser.c?rev=46354&r1=46353&r2=46354&view=diff
==============================================================================
--- trunk/channels/misdn/isdn_msg_parser.c (original)
+++ trunk/channels/misdn/isdn_msg_parser.c Fri Oct 27 06:18:32 2006
@@ -1262,6 +1262,7 @@
 char EVENT_BCHAN_DATA_INFO[] = "BCHAN_DATA";
 char EVENT_BCHAN_ACTIVATED_INFO[] = "BCHAN_ACTIVATED";
 char EVENT_TONE_GENERATE_INFO[] = "TONE_GENERATE";
+char EVENT_BCHAN_ERROR_INFO[] = "BCHAN_ERROR";
 
 char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt)
 {
@@ -1278,6 +1279,7 @@
 	if (event == EVENT_BCHAN_ACTIVATED) return EVENT_BCHAN_ACTIVATED_INFO;
 	if (event == EVENT_TONE_GENERATE) return EVENT_TONE_GENERATE_INFO;
 	if (event == EVENT_PORT_ALARM) return EVENT_PORT_ALARM_INFO;
+	if (event == EVENT_BCHAN_ERROR) return EVENT_BCHAN_ERROR_INFO;
 	
 	return NULL;
 }

Modified: trunk/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn_config.c?rev=46354&r1=46353&r2=46354&view=diff
==============================================================================
--- trunk/channels/misdn_config.c (original)
+++ trunk/channels/misdn_config.c Fri Oct 27 06:18:32 2006
@@ -301,6 +301,9 @@
 		"\tPossible values are positive integers or:\n"
 		"\t   yes (= 4 seconds)\n"
 		"\t   no  (= 0 seconds = disabled)" },
+	{ "nttimeout", MISDN_CFG_NTTIMEOUT, MISDN_CTYPE_BOOL, "no", NONE ,
+		"Set this to yes if you want calls disconnected in overlap mode" 
+		"when a timeout happens.\n"},
 	{ "msns", MISDN_CFG_MSNS, MISDN_CTYPE_MSNLIST, NO_DEFAULT, NONE,
 		"MSN's for TE ports, listen on those numbers on the above ports, and\n"
 		"\tindicate the incoming calls to Asterisk.\n"

Modified: trunk/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/misdn.conf.sample?rev=46354&r1=46353&r2=46354&view=diff
==============================================================================
--- trunk/configs/misdn.conf.sample (original)
+++ trunk/configs/misdn.conf.sample Fri Oct 27 06:18:32 2006
@@ -223,6 +223,13 @@
 ;
 need_more_infos=no
 
+
+;
+; set this to yes if you want to disconnect calls when a timeout occurs
+; for example during the overlapdial phase
+;
+nttimeout=no
+
 ; set the method to use for channel selection:
 ;   standard    - always choose the first free channel with the lowest number
 ;   round_robin - use the round robin algorithm to select a channel. use this



More information about the asterisk-commits mailing list