[asterisk-commits] branch crichter/0.3.0 r8917 - /team/crichter/0.3.0/channels/misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 31 14:20:54 MST 2006


Author: crichter
Date: Mon Jan 30 12:31:25 2006
New Revision: 8917

URL: http://svn.digium.com/view/asterisk?rev=8917&view=rev
Log:

* fixed bad, bad NT Bug:
	litle pbx and gigaset phones should work proper now

* centralized channel provisioning in isdn_msg_parser.c in an own function


Modified:
    team/crichter/0.3.0/channels/misdn/isdn_lib.c
    team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c

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=8917&r1=8916&r2=8917&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Mon Jan 30 12:31:25 2006
@@ -1652,7 +1652,8 @@
 				if (bc) { //repair reject bug
 					int myprocid=bc->l3_id&0x0000ffff;
 					hh->dinfo=(hh->dinfo&0xffff0000)|myprocid;
-					cb_log(4,stack->port,"Repaired reject Bug, new dinfo: %x\n",hh->dinfo);
+					cb_log(3,stack->port,"Repaired reject Bug, new dinfo: %x\n",hh->dinfo);
+					return 0;
 				}
 			}
 		}

Modified: team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c?rev=8917&r1=8916&r2=8917&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c Mon Jan 30 12:31:25 2006
@@ -21,23 +21,43 @@
 
 #include "fac.h"
 
+
+void set_channel(struct misdn_bchannel *bc, int channel) {
+
+	cb_log(3,bc->port,"set_channel: bc->channel:%d channel:%d\n", bc->channel, channel);
+	
+	
+	if (channel==0xff) {
+		/* any channel */
+		channel=-1;
+	}
+	
+	/*  ALERT: is that everytime true ?  */
+	if (channel > 0 && bc->nt ) {
+		
+		if (bc->channel && ( bc->channel != 0xff) ) {
+			cb_log(0,bc->port,"We already have a channel (%d)\n", bc->channel);
+		} else {
+			bc->channel = channel;
+		}
+	}
+	
+	if (channel > 0 && !bc->nt ) 
+		bc->channel = channel;
+}
+
 void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) 
 {
 	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
 	CALL_PROCEEDING_t *proceeding=(CALL_PROCEEDING_t*)((unsigned long)msg->data+ HEADER_LEN);
-	struct misdn_stack *stack=get_stack_by_bc(bc);
+	//struct misdn_stack *stack=get_stack_by_bc(bc);
 	
 	{
 		int  exclusive, channel;
 		dec_ie_channel_id(proceeding->CHANNEL_ID, (Q931_info_t *)proceeding, &exclusive, &channel, nt,bc);
+
+		set_channel(bc,channel);
 		
-		if (channel==0xff) /* any channel */
-			channel=-1;
-    
-		/*  ALERT: is that everytime true ?  */
-
-		if (channel > 0 && stack->nt) 
-			bc->channel = channel;
 	}
 	
 	dec_ie_progress(proceeding->PROGRESS, (Q931_info_t *)proceeding, &bc->progress_coding, &bc->progress_location, &bc->progress_indicator, nt, bc);
@@ -230,11 +250,8 @@
 	{
 		int  exclusive, channel;
 		dec_ie_channel_id(setup->CHANNEL_ID, (Q931_info_t *)setup, &exclusive, &channel, nt,bc);
-		if (channel==0xff) /* any channel */
-			channel=-1;
-
-		if (channel > 0) 
-			bc->channel = channel;
+		
+		set_channel(bc,channel);
 	}
 	
 	dec_ie_progress(setup->PROGRESS, (Q931_info_t *)setup, &bc->progress_coding, &bc->progress_location, &bc->progress_indicator, nt, bc);
@@ -253,9 +270,10 @@
 //	cb_log(2, bc->stack->port, " --> oad %s dad %s channel %d\n",bc->oad, bc->dad,bc->channel);
 	if (bc->channel == 0 || bc->channel == ANY_CHANNEL || bc->channel==-1)
 		enc_ie_channel_id(&setup->CHANNEL_ID, msg, 0, bc->channel, nt,bc);
-	else
+	else 
 		enc_ie_channel_id(&setup->CHANNEL_ID, msg, 1, bc->channel, nt,bc);
-  
+	
+	
 	{
 		int type=bc->onumplan,plan=1,present=bc->pres,screen=bc->screen;
 		enc_ie_calling_pn(&setup->CALLING_PN, msg, type, plan, present,
@@ -358,11 +376,8 @@
 		int  exclusive, channel;
 		dec_ie_channel_id(setup_acknowledge->CHANNEL_ID, (Q931_info_t *)setup_acknowledge, &exclusive, &channel, nt,bc);
 
-		if (channel==0xff) /* any channel */
-			channel=-1;
-
-		if (channel > 0) 
-			bc->channel = channel;
+
+		set_channel(bc, channel);
 	}
 	
 	dec_ie_progress(setup_acknowledge->PROGRESS, (Q931_info_t *)setup_acknowledge, &bc->progress_coding, &bc->progress_location, &bc->progress_indicator, nt, bc);



More information about the asterisk-commits mailing list