ARI: Add the ability to intercept hold and raise an event
[asterisk/asterisk.git] / main / channel.c
index 5efa118..552f4e0 100644 (file)
@@ -1193,8 +1193,8 @@ int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
 
 int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
 {
-       RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
        struct ast_frame f = { AST_FRAME_CONTROL, .subclass.integer = AST_CONTROL_HOLD };
+       struct ast_json *blob = NULL;
        int res;
 
        if (!ast_strlen_zero(musicclass)) {
@@ -1209,6 +1209,8 @@ int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
 
        res = ast_queue_frame(chan, &f);
 
+       ast_json_unref(blob);
+
        return res;
 }