[asterisk-commits] branch crichter/0.3.0 r9002 - in /team/crichter/0.3.0/channels: ./ misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 31 10:28:17 MST 2006


Author: crichter
Date: Tue Jan 31 11:28:14 2006
New Revision: 9002

URL: http://svn.digium.com/view/asterisk?rev=9002&view=rev
Log:
* added support of stopping indications, now i know what the -1 indication is good for, i ever wondered since 1,5 years
* fixed issue with very fast call create/release, which opened a bchannel, but didn't closed it proper


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

Modified: team/crichter/0.3.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn.c?rev=9002&r1=9001&r2=9002&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Tue Jan 31 11:28:14 2006
@@ -1693,7 +1693,7 @@
 		return -1;
 	}
 	
-	chan_misdn_log(1, p->bc->port, "* IND : Indication from %s\n",ast->exten);
+	chan_misdn_log(1, p->bc->port, "* IND : Indication [%d] from %s\n",cond, ast->exten);
 	
 	switch (cond) {
 	case AST_CONTROL_BUSY:
@@ -1733,6 +1733,7 @@
 		break;
 	case AST_CONTROL_ANSWER:
 		chan_misdn_log(1, p->bc->port, " --> * IND :\tanswer pid:%d\n",p->bc?p->bc->pid:-1);
+		start_bc_tones(p);
 		break;
 	case AST_CONTROL_TAKEOFFHOOK:
 		chan_misdn_log(1, p->bc->port, " --> *\ttakeoffhook pid:%d\n",p->bc?p->bc->pid:-1);
@@ -1767,7 +1768,8 @@
 		}
 		break;
 	case -1 :
-		chan_misdn_log(1, p->bc->port, " --> * IND :\t-1! pid:%d\n",p->bc?p->bc->pid:-1);
+		chan_misdn_log(1, p->bc->port, " --> * IND :\t-1! (stop indication) pid:%d\n",p->bc?p->bc->pid:-1);
+		tone_indicate(p, TONE_NONE);
 		break;
 
 	case AST_CONTROL_HOLD:

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=9002&r1=9001&r2=9002&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Tue Jan 31 11:28:14 2006
@@ -1984,8 +1984,12 @@
 		bc->addr = mISDN_get_layerid(stack->midev, bc->b_stid, bc->layer);
 		if (!bc->addr) {
 			cb_log(0,stack->port,"$$$ Get Layer (%d) Id Error: %s\n",bc->layer,strerror(errno));
-			return(-EINVAL);
-		}
+
+			/* we kill the channel later, when we received some
+			   data. */
+			bc->addr= frm->addr;
+		}
+		
 		cb_log(4, stack->port," --> Got Adr %x\n", bc->addr);
 		
 		bc->upset=2;
@@ -2087,7 +2091,10 @@
 					}
 				}
 				
-				cb_event( EVENT_BCHAN_DATA, bc, glob_mgr->user_data);
+				int i=cb_event( EVENT_BCHAN_DATA, bc, glob_mgr->user_data);
+				if (i<0) {
+					clean_up_bc(bc);
+				}
 			}
 		}
 		free_msg(msg);



More information about the asterisk-commits mailing list