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

@@ -140,6 +140,7 @@ struct ast_str *ast_manager_build_bridge_state_string(
suffix, snapshot->num_channels);
if (!res) {
ast_free(out);
return NULL;
}
@@ -239,6 +240,9 @@ static void bridge_merge_cb(void *data, struct stasis_subscription *sub,
to_text = ast_manager_build_bridge_state_string(merge_msg->to, "");
from_text = ast_manager_build_bridge_state_string(merge_msg->from, "From");
if (!to_text || !from_text) {
return;
}
/*** DOCUMENTATION
<managerEventInstance>
@@ -271,6 +275,9 @@ static void channel_enter_cb(void *data, struct stasis_subscription *sub,
bridge_text = ast_manager_build_bridge_state_string(blob->bridge, "");
channel_text = ast_manager_build_channel_state_string(blob->channel);
if (!bridge_text || !channel_text) {
return;
}
manager_event(EVENT_FLAG_CALL, "BridgeEnter",
"%s"
@@ -289,6 +296,9 @@ static void channel_leave_cb(void *data, struct stasis_subscription *sub,
bridge_text = ast_manager_build_bridge_state_string(blob->bridge, "");
channel_text = ast_manager_build_channel_state_string(blob->channel);
if (!bridge_text || !channel_text) {
return;
}
manager_event(EVENT_FLAG_CALL, "BridgeLeave",
"%s"
@@ -312,6 +322,10 @@ static int send_bridge_list_item_cb(void *obj, void *arg, void *data, int flags)
char *id_text = data;
RAII_VAR(struct ast_str *, bridge_info, ast_manager_build_bridge_state_string(snapshot, ""), ast_free);
if (!bridge_info) {
return 0;
}
astman_append(s,
"Event: BridgeListItem\r\n"
"%s"
@@ -367,6 +381,19 @@ static int send_bridge_info_item_cb(void *obj, void *arg, void *data, int flags)
char *uniqueid = obj;
struct mansession *s = arg;
char *id_text = data;
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
struct ast_channel_snapshot *snapshot;
msg = stasis_cache_get(ast_channel_topic_all_cached(),
ast_channel_snapshot_type(), uniqueid);
if (!msg) {
return 0;
}
snapshot = stasis_message_data(msg);
if (snapshot->tech_properties & (AST_CHAN_TP_ANNOUNCER | AST_CHAN_TP_RECORDER)) {
return 0;
}
astman_append(s,
"Event: BridgeInfoChannel\r\n"
@@ -419,7 +446,7 @@ static int manager_bridge_info(struct mansession *s, const struct message *m)
"%s"
"%s"
"\r\n",
ast_str_buffer(bridge_info),
S_COR(bridge_info, ast_str_buffer(bridge_info), ""),
ast_str_buffer(id_text));
return 0;