Stasis: Allow message types to be blocked

This introduces stasis.conf and a mechanism to prevent certain message
types from being published. Internally, this works by preventing the
chosen message types from being created which ensures that those
message types can never be published. This patch also adjusts message
publishers such that message payloads are not created if the related
message type is not available.

ASTERISK-23943 #close
Review: https://reviewboard.asterisk.org/r/3823/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2014-08-06 12:55:28 +00:00
parent ac5c75b45d
commit f1036f40dc
39 changed files with 708 additions and 73 deletions

View File

@@ -357,6 +357,10 @@ static void local_optimization_started_cb(struct ast_unreal_pvt *base, struct as
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
struct local_pvt *p = (struct local_pvt *)base;
if (!ast_local_optimization_begin_type()) {
return;
}
json_object = ast_json_pack("{s: i, s: i}",
"dest", dest, "id", id);
@@ -395,6 +399,10 @@ static void local_optimization_finished_cb(struct ast_unreal_pvt *base, int succ
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
struct local_pvt *p = (struct local_pvt *)base;
if (!ast_local_optimization_end_type()) {
return;
}
json_object = ast_json_pack("{s: i, s: i}", "success", success, "id", id);
if (!json_object) {
@@ -501,6 +509,10 @@ static void publish_local_bridge_message(struct local_pvt *p)
struct ast_channel *owner;
struct ast_channel *chan;
if (!ast_local_bridge_type()) {
return;
}
ast_unreal_lock_all(&p->base, &chan, &owner);
blob = ast_json_pack("{s: s, s: s, s: b}",