mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 04:46:29 +00:00
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:
@@ -136,7 +136,7 @@ static void forkcdr_callback(void *data, struct stasis_subscription *sub, struct
|
||||
static int forkcdr_exec(struct ast_channel *chan, const char *data)
|
||||
{
|
||||
RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct fork_cdr_message_payload *, payload, ao2_alloc(sizeof(*payload), NULL), ao2_cleanup);
|
||||
RAII_VAR(struct fork_cdr_message_payload *, payload, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct stasis_message_router *, router, ast_cdr_message_router(), ao2_cleanup);
|
||||
|
||||
char *parse;
|
||||
@@ -153,6 +153,13 @@ static int forkcdr_exec(struct ast_channel *chan, const char *data)
|
||||
ast_app_parse_options(forkcdr_exec_options, &flags, NULL, args.options);
|
||||
}
|
||||
|
||||
if (!forkcdr_message_type()) {
|
||||
ast_log(AST_LOG_WARNING, "Failed to manipulate CDR for channel %s: no message type\n",
|
||||
ast_channel_name(chan));
|
||||
return -1;
|
||||
}
|
||||
|
||||
payload = ao2_alloc(sizeof(*payload), NULL);
|
||||
if (!payload) {
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user