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:
Kinsey Moore
2013-11-22 20:01:26 +00:00
parent 1ac597135a
commit 0045449943
16 changed files with 314 additions and 80 deletions

View File

@@ -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);