[asterisk-commits] crichter: branch 1.4 r89171 - in /branches/1.4/channels: ./ misdn/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 12 05:13:15 CST 2007


Author: crichter
Date: Mon Nov 12 05:13:13 2007
New Revision: 89171

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89171
Log:
fixed a state/event issue with overlapdial=yes when no extension matched. removed the general sending of a RELEASE_COMPLETE when we receive a RELEASE, this is done by mISDNuser/mISDN. This makes it possible to use asterisk-1.4 with mISDN trunk, but requires users of mISDN/mISDNuser-1.1.X to upgrade to at least mISDNuser-1.1.6 (when using the NT mode at all)

Modified:
    branches/1.4/channels/chan_misdn.c
    branches/1.4/channels/misdn/isdn_lib.c

Modified: branches/1.4/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_misdn.c?view=diff&rev=89171&r1=89170&r2=89171
==============================================================================
--- branches/1.4/channels/chan_misdn.c (original)
+++ branches/1.4/channels/chan_misdn.c Mon Nov 12 05:13:13 2007
@@ -684,6 +684,7 @@
 misdn_overlap_dial_task_disconnect:
 			hanguptone_indicate(ch);
 			ch->bc->out_cause=1;
+			ch->state=MISDN_CLEANING;
 			misdn_lib_send_event(ch->bc, EVENT_DISCONNECT);
 		}
 		ch->overlap_dial_task = -1;
@@ -5010,9 +5011,7 @@
 	
 		misdn_cfg_get( 0, MISDN_GEN_NTDEBUGFLAGS, &ntflags, sizeof(int));
 		misdn_cfg_get( 0, MISDN_GEN_NTDEBUGFILE, &ntfile, BUFFERSIZE);
-
 		misdn_lib_nt_debug_init(ntflags,ntfile);
-
 
 		misdn_cfg_get( 0, MISDN_GEN_NTKEEPCALLS, &ntkc, sizeof(int));
 		misdn_lib_nt_keepcalls(ntkc);

Modified: branches/1.4/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/isdn_lib.c?view=diff&rev=89171&r1=89170&r2=89171
==============================================================================
--- branches/1.4/channels/misdn/isdn_lib.c (original)
+++ branches/1.4/channels/misdn/isdn_lib.c Mon Nov 12 05:13:13 2007
@@ -28,6 +28,8 @@
 struct misdn_stack* get_misdn_stack( void );
 
 static int set_chan_in_stack(struct misdn_stack *stack, int channel);
+
+int release_cr(struct misdn_stack *stack, mISDNuser_head_t *hh);
 
 int misdn_lib_port_is_pri(int port)
 {
@@ -1765,6 +1767,38 @@
 }
 
 
+int release_cr(struct misdn_stack *stack, mISDNuser_head_t *hh)
+{
+	struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
+	struct misdn_bchannel dummybc;
+	iframe_t frm; /* fake te frm to remove callref from global callreflist */
+	frm.dinfo = hh->dinfo;
+
+	frm.addr=stack->upper_id | FLG_MSG_DOWN;
+
+	frm.prim = CC_RELEASE_CR|INDICATION;
+	cb_log(4, stack->port, " --> CC_RELEASE_CR: Faking Realease_cr for %x l3id:%x\n",frm.addr, frm.dinfo);
+	/** removing procid **/
+	if (!bc) {
+		cb_log(4, stack->port, " --> Didn't found BC so temporarly creating dummy BC (l3id:%x) on this port.\n", hh->dinfo);
+		make_dummy(&dummybc, stack->port, hh->dinfo, stack->nt, 0);
+		bc=&dummybc; 
+	}
+
+	if (bc) {
+		if ( (bc->l3_id & 0xff00) == 0xff00) {
+			cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", bc->l3_id&0xff);
+			stack->procids[bc->l3_id&0xff] = 0 ;
+		}
+	}
+	else cb_log(0, stack->port, "Couldnt find BC so I couldnt remove the Process!!!! this is a bad port.\n");
+
+	if (handle_cr(stack, &frm)<0) {
+	}
+
+	return 0 ;
+}
+
 int
 handle_event_nt(void *dat, void *arg)
 {
@@ -1913,43 +1947,23 @@
 			break;
 
 		case CC_RELEASE|CONFIRM:
+			{
+				struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
+
+				if (bc) { 
+					cb_log(1, stack->port, "CC_RELEASE|CONFIRM (l3id:%x), sending RELEASE_COMPLETE\n", hh->dinfo);
+					misdn_lib_send_event(bc, EVENT_RELEASE_COMPLETE);
+				}
+			}
 			break;
 			
 		case CC_RELEASE|INDICATION:
 			break;
 
 		case CC_RELEASE_CR|INDICATION:
-		{
-			struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
-			struct misdn_bchannel dummybc;
-			iframe_t frm; /* fake te frm to remove callref from global callreflist */
-			frm.dinfo = hh->dinfo;
-
-			frm.addr=stack->upper_id | FLG_MSG_DOWN;
-
-			frm.prim = CC_RELEASE_CR|INDICATION;
-			cb_log(4, stack->port, " --> Faking Realease_cr for %x\n",frm.addr);
-			/** removing procid **/
-			if (!bc) {
-				cb_log(4, stack->port, " --> Didn't found BC so temporarly creating dummy BC (l3id:%x) on this port.\n", hh->dinfo);
-				make_dummy(&dummybc, stack->port, hh->dinfo, stack->nt, 0);
-				bc=&dummybc; 
-			}
-	
-			if (bc) {
-				if ( (bc->l3_id & 0xff00) == 0xff00) {
-					cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", bc->l3_id&0xff);
-					stack->procids[bc->l3_id&0xff] = 0 ;
-				}
-			}
-			else cb_log(0, stack->port, "Couldnt find BC so I couldnt remove the Process!!!! this is a bad port.\n");
-	
-			if (handle_cr(stack, &frm)<0) {
-			}
-
+			release_cr(stack, hh);
 			free_msg(msg);
 			return 0 ;
-		}
 		break;
       
 		case CC_NEW_CR|INDICATION:
@@ -2083,7 +2097,6 @@
 				}
 				cb_event(event, bc, glob_mgr->user_data);
 			}
-      
 		} else {
 			cb_log(4, stack->port, "No BC found with l3id: prim %x dinfo %x\n",hh->prim, hh->dinfo);
 		}




More information about the asterisk-commits mailing list