[asterisk-commits] mjordan: branch 12 r402090 - /branches/12/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 27 18:22:20 CDT 2013


Author: mjordan
Date: Sun Oct 27 18:22:19 2013
New Revision: 402090

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402090
Log:
Filter out internal channels from dial message handling

Surrogate channels would pop up from time to time in dial message handling.
This would cause a WARNING message to appear, indicating that the Surrogate
channel had no CDR. This patch filters out those channels that have the
internal implementation flag set, such that the WARNING message isn't
displayed.

Modified:
    branches/12/main/cdr.c

Modified: branches/12/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/cdr.c?view=diff&rev=402090&r1=402089&r2=402090
==============================================================================
--- branches/12/main/cdr.c (original)
+++ branches/12/main/cdr.c Sun Oct 27 18:22:19 2013
@@ -1832,6 +1832,35 @@
 	return 1;
 }
 
+/*!
+ * \internal
+ * \brief Filter channel snapshots by technology
+ */
+static int filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
+{
+	return snapshot->tech_properties & AST_CHAN_TP_INTERNAL;
+}
+
+/*!
+ * \internal
+ * \brief Filter a channel cache update
+ */
+static int filter_channel_cache_message(struct ast_channel_snapshot *old_snapshot,
+		struct ast_channel_snapshot *new_snapshot)
+{
+	int ret = 0;
+
+	/* Drop cache updates from certain channel technologies */
+	if (old_snapshot) {
+		ret |= filter_channel_snapshot(old_snapshot);
+	}
+	if (new_snapshot) {
+		ret |= filter_channel_snapshot(new_snapshot);
+	}
+
+	return ret;
+}
+
 /* TOPIC ROUTER CALLBACKS */
 
 /*!
@@ -1869,6 +1898,10 @@
 			peer ? peer->name : "(none)",
 			(unsigned int)stasis_message_timestamp(message)->tv_sec,
 			(unsigned int)stasis_message_timestamp(message)->tv_usec);
+
+	if (filter_channel_snapshot(peer) || (caller && filter_channel_snapshot(caller))) {
+		return;
+	}
 
 	/* Figure out who is running this show */
 	if (caller) {
@@ -1957,35 +1990,6 @@
 		}
 	}
 	return 0;
-}
-
-/*!
- * \internal
- * \brief Filter channel snapshots by technology
- */
-static int filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
-{
-	return snapshot->tech_properties & AST_CHAN_TP_INTERNAL;
-}
-
-/*!
- * \internal
- * \brief Filter a channel cache update
- */
-static int filter_channel_cache_message(struct ast_channel_snapshot *old_snapshot,
-		struct ast_channel_snapshot *new_snapshot)
-{
-	int ret = 0;
-
-	/* Drop cache updates from certain channel technologies */
-	if (old_snapshot) {
-		ret |= filter_channel_snapshot(old_snapshot);
-	}
-	if (new_snapshot) {
-		ret |= filter_channel_snapshot(new_snapshot);
-	}
-
-	return ret;
 }
 
 /*! \brief Determine if we need to add a new CDR based on snapshots */




More information about the asterisk-commits mailing list