/*! * \internal * \brief Publish a hangup handler related message to \ref stasis */ 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); blob = ast_json_pack("{s: s, s: s}", "type", action, "handler", S_OR(handler, "")); if (!blob) { return; } ast_channel_publish_blob(chan, ast_channel_hangup_handler_type(), blob); }
void ast_channel_publish_varset(struct ast_channel *chan, const char *name, const char *value) { RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref); ast_assert(name != NULL); ast_assert(value != NULL); blob = ast_json_pack("{s: s, s: s}", "variable", name, "value", value); if (!blob) { ast_log(LOG_ERROR, "Error creating message\n"); return; } ast_channel_publish_blob(chan, ast_channel_varset_type(), blob); }