mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
ARI: Don't leak implementation details
This change prevents channels used as implementation details from leaking out to ARI. It does this by preventing creation of JSON blobs of channel snapshots created from those channels and sanitizing JSON blobs of bridge snapshots as they are created. This introduces a framework for excluding information from output targeted at Stasis applications on a consumer-by-consumer basis using channel sanitization callbacks which could be extended to bridges or endpoints if necessary. This prevents unhelpful error messages from being generated by ast_json_pack. This also corrects a bug where BridgeCreated events would not be created. (closes issue ASTERISK-22744) Review: https://reviewboard.asterisk.org/r/2987/ Reported by: David M. Lee git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -690,7 +690,7 @@ struct ast_json *ast_json_vpack(char const *format, va_list ap)
|
||||
struct ast_json *r = NULL;
|
||||
if (format) {
|
||||
r = (struct ast_json *)json_vpack_ex(&error, 0, format, ap);
|
||||
if (!r) {
|
||||
if (!r && !ast_strlen_zero(error.text)) {
|
||||
ast_log(LOG_ERROR,
|
||||
"Error building JSON from '%s': %s.\n",
|
||||
format, error.text);
|
||||
|
Reference in New Issue
Block a user