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
This commit is contained in:
Kinsey Moore
2013-07-19 19:23:39 +00:00
parent 0b83761f9a
commit 5a8f32703c
11 changed files with 90 additions and 11 deletions

View File

@@ -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;
}