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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri May 18 02:47:20 MST 2007


Author: crichter
Date: Fri May 18 04:47:19 2007
New Revision: 64954

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

................
r59774 | crichter | 2007-04-03 09:20:27 +0200 (Di, 03 Apr 2007) | 17 lines

Merged revisions 59623-59624,59639 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59623 | crichter | 2007-04-02 09:12:24 +0200 (Mo, 02 Apr 2007) | 1 line

we can now make 30 channels on a PRI (before we forgot chan 31..)
........
r59624 | crichter | 2007-04-02 09:25:54 +0200 (Mo, 02 Apr 2007) | 1 line

don't be verbose if no need
........
r59639 | crichter | 2007-04-02 14:08:12 +0200 (Mo, 02 Apr 2007) | 1 line

added option which allows us to accept incoming SETUP Messages without automatically sending Proceeding or Setup Acknowledge, this is useful with some broken switches and if you want to Release incoming calls without previously having acknowledged them. The new option is noautorespond_on_setup=yes|no default is no, so we don't break the existing behaviour
........

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

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_config.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=64954&r1=64953&r2=64954
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Fri May 18 04:47:19 2007
@@ -117,6 +117,7 @@
 	MISDN_NOTHING=0,	/*!< at beginning */
 	MISDN_WAITING4DIGS, /*!<  when waiting for infos */
 	MISDN_EXTCANTMATCH, /*!<  when asterisk couldnt match our ext */
+	MISDN_INCOMING_SETUP, /*!<  for incoming setups*/
 	MISDN_DIALING, /*!<  when pbx_start */
 	MISDN_PROGRESS, /*!<  we got a progress */
 	MISDN_PROCEEDING, /*!<  we got a progress */
@@ -156,7 +157,8 @@
 	int need_busy;
 	
 	int originator;
-
+	int noautorespond_on_setup;
+	
 	int norxtone;
 	int notxtone; 
 
@@ -986,6 +988,7 @@
 	{MISDN_NOTHING,"NOTHING"}, /* at beginning */
 	{MISDN_WAITING4DIGS,"WAITING4DIGS"}, /*  when waiting for infos */
 	{MISDN_EXTCANTMATCH,"EXTCANTMATCH"}, /*  when asterisk couldnt match our ext */
+	{MISDN_INCOMING_SETUP,"INCOMING SETUP"}, /*  when pbx_start */
 	{MISDN_DIALING,"DIALING"}, /*  when pbx_start */
 	{MISDN_PROGRESS,"PROGRESS"}, /*  when pbx_start */
 	{MISDN_PROCEEDING,"PROCEEDING"}, /*  when pbx_start */
@@ -1747,6 +1750,8 @@
 	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_NOAUTORESPOND_ON_SETUP, &ch->noautorespond_on_setup, sizeof(int));
+	
 	misdn_cfg_get( port, MISDN_CFG_FAR_ALERTING, &ch->far_alerting, sizeof(int));
 
 	misdn_cfg_get( port, MISDN_CFG_ALLOWED_BEARERS, &ch->allowed_bearers, BUFFERSIZE);
@@ -2059,11 +2064,11 @@
 		misdn_cfg_get( 0, MISDN_GEN_BRIDGING, &bridging, sizeof(int));
 		if (bridging && ch->other_ch) {
 #ifdef MISDN_1_2
-			chan_misdn_log(0, port, "Disabling EC (aka Pipeline) on both Sides\n");
+			chan_misdn_log(1, port, "Disabling EC (aka Pipeline) on both Sides\n");
 			*ch->bc->pipeline=0;
 			*ch->other_ch->bc->pipeline=0;
 #else
-			chan_misdn_log(0, port, "Disabling EC on both Sides\n");
+			chan_misdn_log(1, port, "Disabling EC on both Sides\n");
 			ch->bc->ec_enable=0;
 			ch->other_ch->bc->ec_enable=0;
 #endif
@@ -2439,6 +2444,7 @@
 		chan_misdn_log(2, bc->port, " --> state:%s\n", misdn_get_ch_state(p));
 		
 		switch (p->state) {
+		case MISDN_INCOMING_SETUP:
 		case MISDN_CALLING:
 			p->state=MISDN_CLEANING;
 			misdn_lib_send_event( bc, EVENT_RELEASE_COMPLETE);
@@ -3535,16 +3541,20 @@
   
 	ch->state=MISDN_DIALING;
 
-	if (bc->nt) {
-		int ret; 
-		ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
-	} else {
-		int ret;
-		if ( misdn_lib_is_ptp(bc->port)) {
+	if (!ch->noautorespond_on_setup) {
+		if (bc->nt) {
+			int ret; 
 			ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
 		} else {
-			ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
-		}
+			int ret;
+			if ( misdn_lib_is_ptp(bc->port)) {
+				ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+			} else {
+				ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
+			}
+		}
+	} else {
+		ch->state = MISDN_INCOMING_SETUP;
 	}
 
 	if ( !bc->nt && (ch->originator==ORG_MISDN) && !ch->incoming_early_audio ) 
@@ -4106,8 +4116,12 @@
 		
 		/* Check for Pickup Request first */
 		if (!strcmp(chan->exten, ast_pickup_ext())) {
-			int ret;/** Sending SETUP_ACK**/
-			ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+			if (!ch->noautorespond_on_setup) {
+				int ret;/** Sending SETUP_ACK**/
+				ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+			} else {
+				ch->state = MISDN_INCOMING_SETUP;
+			}
 			if (ast_pickup_call(chan)) {
 				hangup_chan(ch);
 			} else {
@@ -4165,14 +4179,19 @@
 		}
 		
 		if (!ch->overlap_dial && ast_exists_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
-			ch->state=MISDN_DIALING;
 			
-			if (bc->nt || (bc->need_more_infos && misdn_lib_is_ptp(bc->port)) ) {
-				int ret; 
-				ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+			if (!ch->noautorespond_on_setup) {
+				ch->state=MISDN_DIALING;
+
+				if (bc->nt || (bc->need_more_infos && misdn_lib_is_ptp(bc->port)) ) {
+					int ret; 
+					ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+				} else {
+					int ret;
+					ret= misdn_lib_send_event(bc, EVENT_PROCEEDING );
+				}
 			} else {
-				int ret;
-				ret= misdn_lib_send_event(bc, EVENT_PROCEEDING );
+				ch->state = MISDN_INCOMING_SETUP;
 			}
 	
 			if (pbx_start_chan(ch)<0) {
@@ -4202,7 +4221,6 @@
 				}
 
 			} else {
-
 				int ret= misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
 				if (ret == -ENOCHAN) {
 					ast_log(LOG_WARNING,"Channel was catched, before we could Acknowledge\n");

Modified: trunk/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/chan_misdn_config.h?view=diff&rev=64954&r1=64953&r2=64954
==============================================================================
--- trunk/channels/misdn/chan_misdn_config.h (original)
+++ trunk/channels/misdn/chan_misdn_config.h Fri May 18 04:47:19 2007
@@ -65,6 +65,7 @@
 	MISDN_CFG_BNEC_ADAPT,
 #endif
 	MISDN_CFG_NEED_MORE_INFOS,     /* bool */
+	MISDN_CFG_NOAUTORESPOND_ON_SETUP,     /* bool */
 	MISDN_CFG_NTTIMEOUT,     /* bool */
 	MISDN_CFG_JITTERBUFFER,              /* int */
 	MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD,              /* int */

Modified: trunk/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.c?view=diff&rev=64954&r1=64953&r2=64954
==============================================================================
--- trunk/channels/misdn/isdn_lib.c (original)
+++ trunk/channels/misdn/isdn_lib.c Fri May 18 04:47:19 2007
@@ -443,9 +443,11 @@
 	}
 	
 	channel--;
+
+	int bnums=stack->pri?stack->b_num:stack->b_num-1;
  
  	if (dec) {
-		for (i = stack->b_num-1; i >=0; i--) {
+		for (i = bnums; i >=0; i--) {
 			if (i != 15 && (channel < 0 || i == channel)) { /* skip E1 Dchannel ;) and work with chan preselection */
 				if (!stack->channels[i]) {
 					cb_log (3, stack->port, " --> found chan%s: %d\n", channel>=0?" (preselected)":"", i+1);
@@ -455,7 +457,7 @@
 			}
 		}
 	} else {
-		for (i = 0; i < stack->b_num; i++) {
+		for (i = 0; i <= bnums; i++) {
 			if (i != 15 && (channel < 0 || i == channel)) { /* skip E1 Dchannel ;) and work with chan preselection */
 				if (!stack->channels[i]) {
 					cb_log (3, stack->port, " --> found chan%s: %d\n", channel>=0?" (preselected)":"", i+1);

Modified: trunk/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn_config.c?view=diff&rev=64954&r1=64953&r2=64954
==============================================================================
--- trunk/channels/misdn_config.c (original)
+++ trunk/channels/misdn_config.c Fri May 18 04:47:19 2007
@@ -261,6 +261,11 @@
 		"Send Setup_Acknowledge on incoming calls anyway (instead of PROCEEDING),\n"
 		"\tthis requests additional Infos, so we can waitfordigits without much\n"
 		"\tissues. This works only for PTP Ports" },
+	{ "noautorespond_on_setup", MISDN_CFG_NOAUTORESPOND_ON_SETUP, MISDN_CTYPE_BOOL, "0", NONE,
+		"Do not send SETUP_ACKNOWLEDGE or PROCEEDING automatically to the calling Party.\n"
+		"Instead we directly jump into the dialplan. This might be useful for fast call\n"
+		"rejection, or for some broken switches, that need hangup causes like busy in the.\n"
+		"RELEASE_COMPLETE Message, instead of the DISCONNECT Message.\n"},
 	{ "jitterbuffer", MISDN_CFG_JITTERBUFFER, MISDN_CTYPE_INT, "4000", NONE,
 		"The jitterbuffer." },
 	{ "jitterbuffer_upper_threshold", MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, MISDN_CTYPE_INT, "0", NONE,



More information about the asterisk-commits mailing list