diff --git a/apps/app_fax.c b/apps/app_fax.c index a7b9e53d12e0e32e02828f3e7e1be80b1c165e35..e23ac431e6905629a38ec0c70ffcd74846420d1d 100644 --- a/apps/app_fax.c +++ b/apps/app_fax.c @@ -268,7 +268,7 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result) "fax_resolution", stat.y_resolution, "fax_bitrate", stat.bit_rate, "filenames", json_filenames); - message = ast_channel_cached_blob_create(s->chan, ast_channel_fax_type(), json_object); + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(s->chan), ast_channel_fax_type(), json_object); if (!message) { return; } diff --git a/include/asterisk/stasis_channels.h b/include/asterisk/stasis_channels.h index 42e50eb08a08446012966fb50f3aa5092554a1c8..e3beb03cebdc6315f79434857205bbf976ca422f 100644 --- a/include/asterisk/stasis_channels.h +++ b/include/asterisk/stasis_channels.h @@ -153,27 +153,6 @@ struct ast_channel_snapshot *ast_channel_snapshot_get_latest(const char *uniquei struct stasis_message *ast_channel_blob_create(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob); -/*! - * \since 12 - * \brief Creates a \ref ast_channel_blob message using the current cached - * \ref ast_channel_snapshot for the passed in \ref ast_channel - * - * The given \a blob should be treated as immutable and not modified after it is - * put into the message. - * - * \param chan Channel blob is associated with, or \c NULL for global/all channels. - * \param type Message type for this blob. - * \param blob JSON object representing the data, or \c NULL for no data. If - * \c NULL, ast_json_null() is put into the object. - * - * \param chan Channel blob is associated with - * \param blob JSON object representing the data. - * \return \ref ast_channel_blob message. - * \return \c NULL on error - */ -struct stasis_message *ast_channel_cached_blob_create(struct ast_channel *chan, - struct stasis_message_type *type, struct ast_json *blob); - /*! * \since 12 * \brief Create a \ref ast_channel_blob message, pulling channel state from diff --git a/main/stasis_channels.c b/main/stasis_channels.c index 249576b49bc149c33a50f8ca6d183595b2d904d7..0ec40bbfbfe8dc1c827be68ee0f11ae8ad20654c 100644 --- a/main/stasis_channels.c +++ b/main/stasis_channels.c @@ -250,12 +250,12 @@ static struct stasis_message *create_channel_blob_message(struct ast_channel_sna return msg; } -struct stasis_message *ast_channel_cached_blob_create(struct ast_channel *chan, +struct stasis_message *ast_channel_blob_create_from_cache(const char *channel_id, struct stasis_message_type *type, struct ast_json *blob) { RAII_VAR(struct ast_channel_snapshot *, snapshot, - ast_channel_snapshot_get_latest(ast_channel_uniqueid(chan)), + ast_channel_snapshot_get_latest(channel_id), ao2_cleanup); return create_channel_blob_message(snapshot, type, blob); diff --git a/res/res_fax.c b/res/res_fax.c index 1a9f4f749f5abb65eed9d16a11ef667f7baa412a..68cd0f272af3b8bbdc3b688def628b20fe5fd705 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -1197,7 +1197,7 @@ static int report_fax_status(struct ast_channel *chan, struct ast_fax_session_de { SCOPED_CHANNELLOCK(lock, chan); - message = ast_channel_cached_blob_create(chan, ast_channel_fax_type(), json_object); + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), ast_channel_fax_type(), json_object); if (!message) { return -1; } @@ -1789,7 +1789,7 @@ static int report_receive_fax_status(struct ast_channel *chan, const char *filen return -1; } - message = ast_channel_cached_blob_create(chan, ast_channel_fax_type(), json_object); + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), ast_channel_fax_type(), json_object); if (!message) { return -1; } @@ -2269,7 +2269,7 @@ static int report_send_fax_status(struct ast_channel *chan, struct ast_fax_sessi return -1; } - message = ast_channel_cached_blob_create(chan, ast_channel_fax_type(), json_obj); + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), ast_channel_fax_type(), json_obj); if (!message) { return -1; } diff --git a/res/res_monitor.c b/res/res_monitor.c index 72911b5b1d4229d8d567a29ffffc5caddfe3a49d..f1da4ec834b6390071ddf8d2748058ad60803c74 100644 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -396,7 +396,7 @@ int AST_OPTIONAL_API_NAME(ast_monitor_start)(struct ast_channel *chan, const cha /* so we know this call has been monitored in case we need to bill for it or something */ pbx_builtin_setvar_helper(chan, "__MONITORED","true"); - message = ast_channel_cached_blob_create(chan, + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), ast_channel_monitor_start_type(), NULL); if (message) { @@ -516,7 +516,7 @@ int AST_OPTIONAL_API_NAME(ast_monitor_stop)(struct ast_channel *chan, int need_l ast_free(ast_channel_monitor(chan)); ast_channel_monitor_set(chan, NULL); - message = ast_channel_cached_blob_create(chan, + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), ast_channel_monitor_stop_type(), NULL); if (message) { diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 2ed7ea52b75ee21941ef7d2b71b29fbb4da4874e..df6c7d787b266217f0de8be05f29802c43abf707 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1585,7 +1585,7 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con return -1; } - message = ast_channel_cached_blob_create(chan, + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), ast_channel_moh_start_type(), json_object); if (message) { @@ -1611,7 +1611,7 @@ static void local_ast_moh_stop(struct ast_channel *chan) } } - message = ast_channel_cached_blob_create(chan, ast_channel_moh_stop_type(), NULL); + message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), ast_channel_moh_stop_type(), NULL); if (message) { stasis_publish(ast_channel_topic(chan), message); }