summaryrefslogtreecommitdiff
path: root/main/pbx.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-05-31 19:00:51 +0000
committerKinsey Moore <kmoore@digium.com>2013-05-31 19:00:51 +0000
commit1458a20e47fc1cab9a22a961bff0745f7368b447 (patch)
tree6ecbfd8bb7c54fd331450f6d649fefb927556514 /main/pbx.c
parent680765d452f3c19ed6be54919503e8c7fad905ce (diff)
Refactor code and fix a reference leak
Refactor some channel blob publishing code to use ast_channel_publish_blob now that it is available and fix a JSON reference leak that was occurring during varset publishing. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 97cd1d105..98871e0a0 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -5776,7 +5776,6 @@ void ast_pbx_h_exten_run(struct ast_channel *chan, const char *context)
static void publish_hangup_handler_message(const char *action, struct ast_channel *chan, const char *handler)
{
RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
- RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
blob = ast_json_pack("{s: s, s: s}",
"type", action,
@@ -5785,12 +5784,7 @@ static void publish_hangup_handler_message(const char *action, struct ast_channe
return;
}
- message = ast_channel_blob_create(chan, ast_channel_hangup_handler_type(), blob);
- if (!message) {
- return;
- }
-
- stasis_publish(ast_channel_topic(chan), message);
+ ast_channel_publish_blob(chan, ast_channel_hangup_handler_type(), blob);
}
int ast_pbx_hangup_handler_run(struct ast_channel *chan)