summaryrefslogtreecommitdiff
path: root/main/cel.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-07-19 19:23:39 +0000
committerKinsey Moore <kmoore@digium.com>2013-07-19 19:23:39 +0000
commit5a8f32703c445f7d09b5e029e85d76692626a67f (patch)
treeb8ad7eea354b19249f7ccf593f65584e5c1b5625 /main/cel.c
parent0b83761f9a99d18105ad6cb13dd0282a85641f03 (diff)
Filter channels used as internal mechanisms
This adds new flags to the channel tech properties that flag it as different types of implementation detail used exclusively to provide a feature. Examples of channels that would have these flags include the announcement and recording channels used by confbridge which are the only two marked as such by this patch. Review: https://reviewboard.asterisk.org/r/2633/ (closes issue ASTERISK-21873) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cel.c')
-rw-r--r--main/cel.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/main/cel.c b/main/cel.c
index 209d1451a..0e9519a1d 100644
--- a/main/cel.c
+++ b/main/cel.c
@@ -1196,6 +1196,14 @@ static void clear_bridge_primary(const char *bridge_id)
ao2_callback(bridge_primaries, OBJ_KEY | OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, bridge_match_cb, dup_id);
}
+static int cel_filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
+{
+ if (!snapshot) {
+ return 0;
+ }
+ return snapshot->tech_properties & (AST_CHAN_TP_ANNOUNCER | AST_CHAN_TP_RECORDER);
+}
+
static void cel_snapshot_update_cb(void *data, struct stasis_subscription *sub,
struct stasis_topic *topic,
struct stasis_message *message)
@@ -1209,6 +1217,10 @@ static void cel_snapshot_update_cb(void *data, struct stasis_subscription *sub,
old_snapshot = stasis_message_data(update->old_snapshot);
new_snapshot = stasis_message_data(update->new_snapshot);
+ if (cel_filter_channel_snapshot(old_snapshot) || cel_filter_channel_snapshot(new_snapshot)) {
+ return;
+ }
+
update_bridge_primary(new_snapshot);
for (i = 0; i < ARRAY_LEN(cel_channel_monitors); ++i) {
@@ -1242,6 +1254,10 @@ static void cel_bridge_enter_cb(
struct ast_channel_snapshot *chan_snapshot = blob->channel;
RAII_VAR(struct bridge_assoc *, assoc, find_bridge_primary_by_bridge_id(snapshot->uniqueid), ao2_cleanup);
+ if (cel_filter_channel_snapshot(chan_snapshot)) {
+ return;
+ }
+
if (snapshot->capabilities & (AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE)) {
if (assoc && assoc->track_as_conf) {
report_event_snapshot(chan_snapshot, AST_CEL_CONF_ENTER, NULL, NULL, NULL);
@@ -1303,6 +1319,10 @@ static void cel_bridge_leave_cb(
struct ast_bridge_snapshot *snapshot = blob->bridge;
struct ast_channel_snapshot *chan_snapshot = blob->channel;
+ if (cel_filter_channel_snapshot(chan_snapshot)) {
+ return;
+ }
+
if (snapshot->capabilities & (AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE)) {
RAII_VAR(struct bridge_assoc *, assoc,
find_bridge_primary_by_bridge_id(snapshot->uniqueid),
@@ -1366,6 +1386,10 @@ static void cel_dial_cb(void *data, struct stasis_subscription *sub,
{
struct ast_multi_channel_blob *blob = stasis_message_data(message);
+ if (cel_filter_channel_snapshot(ast_multi_channel_blob_get_channel(blob, "caller"))) {
+ return;
+ }
+
if (!get_caller_uniqueid(blob)) {
return;
}