[asterisk-commits] moy: trunk r213216 - /trunk/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 19 22:27:04 CDT 2009


Author: moy
Date: Wed Aug 19 22:26:59 2009
New Revision: 213216

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=213216
Log:
fixed bug caused by calling ast_request without calling ast_call on an R2 channel, ie, CHANISAVAIL

Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=213216&r1=213215&r2=213216
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Wed Aug 19 22:26:59 2009
@@ -4619,6 +4619,7 @@
 	if (p->mfcr2) {
 		openr2_calling_party_category_t chancat;
 		int callres = 0;
+		char *c, *l;
 
 		c = strchr(dest, '/');
 		if (c) {
@@ -5255,7 +5256,7 @@
 		}
 #endif
 #ifdef HAVE_OPENR2
-		if (p->mfcr2) {
+		if (p->mfcr2 && p->mfcr2call && openr2_chan_get_direction(p->r2chan) != OR2_DIR_STOPPED) {
 			ast_log(LOG_DEBUG, "disconnecting MFC/R2 call on chan %d\n", p->channel);
 			/* If it's an incoming call, check the mfcr2_forced_release setting */
 			if (openr2_chan_get_direction(p->r2chan) == OR2_DIR_BACKWARD && p->mfcr2_forced_release) {
@@ -5268,6 +5269,9 @@
 				openr2_chan_disconnect_call(p->r2chan, r2cause);
 			}
 			dahdi_r2_update_monitor_count(p->mfcr2, 1);
+		} else if (p->mfcr2call) {
+			ast_log(LOG_DEBUG, "Clearing call request on channel %d\n", p->channel);
+			p->mfcr2call = 0;
 		}
 #endif
 		switch (p->sig) {
@@ -11510,6 +11514,9 @@
 				tmp->cdrflags |= AST_CDR_CALLWAIT;
 			break;
 		}
+#ifdef HAVE_OPENR2
+next:
+#endif
 		if (backwards) {
 			p = p->prev;
 			if (!p)




More information about the asterisk-commits mailing list