[asterisk-commits] russell: branch russell/issue_13747 r163683 - /team/russell/issue_13747/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 12 13:18:13 CST 2008


Author: russell
Date: Fri Dec 12 13:18:12 2008
New Revision: 163683

URL: http://svn.digium.com/view/asterisk?view=rev&rev=163683
Log:
There are a bunch of indications where it doesn't make sense to store
then on the channel.  We really only care about stuff like BUSY, RINGING,
or CONGESTION.

Modified:
    team/russell/issue_13747/main/channel.c

Modified: team/russell/issue_13747/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_13747/main/channel.c?view=diff&rev=163683&r1=163682&r2=163683
==============================================================================
--- team/russell/issue_13747/main/channel.c (original)
+++ team/russell/issue_13747/main/channel.c Fri Dec 12 13:18:12 2008
@@ -2453,18 +2453,23 @@
 	int res = -1;
 
 	ast_channel_lock(chan);
-	/* Stop if we're a zombie or need a soft hangup */
+
+	/* Don't bother if the channel is about to go away, anyway. */
 	if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
 		ast_channel_unlock(chan);
 		return -1;
 	}
-	if (chan->tech->indicate)
+
+	if (chan->tech->indicate) {
 		res = chan->tech->indicate(chan, condition, data, datalen);
+	}
+
 	ast_channel_unlock(chan);
+
 	if (!chan->tech->indicate || res) {
 		/*
 		 * Device does not support (that) indication, lets fake
-		 * it by doing our own tone generation. (PM2002)
+		 * it by doing our own tone generation.
 		 */
 		if (condition < 0)
 			ast_playtones_stop(chan);
@@ -2505,8 +2510,28 @@
 				res = -1;
 			}
 		}
-	} else
-		chan->visible_indication = condition;
+	} else {
+		/* There are some conditions where we don't want to store them off as
+		 * visible indications.  List them here. */
+		switch (condition) {
+		case AST_CONTROL_PROGRESS:
+		case AST_CONTROL_PROCEEDING:
+		case AST_CONTROL_VIDUPDATE:
+		case AST_CONTROL_SRCUPDATE:
+		case AST_CONTROL_RADIO_KEY:
+		case AST_CONTROL_RADIO_UNKEY:
+		case AST_CONTROL_OPTION:
+		case AST_CONTROL_WINK:
+		case AST_CONTROL_FLASH:
+		case AST_CONTROL_OFFHOOK:
+		case AST_CONTROL_TAKEOFFHOOK:
+		case AST_CONTROL_ANSWER:
+		case AST_CONTROL_HANGUP:
+			break;
+		default:
+			chan->visible_indication = condition;
+		}
+	}
 
 	return res;
 }




More information about the asterisk-commits mailing list