mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
json: Take advantage of new API's.
* Use "o*" format specifier for optional fields in ast_json_party_id. * Stop using ast_json_deep_copy on immutable objects, it is now thread safe to just use ast_json_ref. Additional changes to ast_json_pack calls in the vicinity: * Use "O" when an object needs to be bumped. This was previously avoided as it was not thread safe. * Use "o?" and "O?" to replace NULL with ast_json_null(). The "?" is a new feature of ast_json_pack starting with Asterisk 16. Change-Id: I8382d28d7d83ee0ce13334e51ae45dbc0bdaef48
This commit is contained in:
@@ -111,9 +111,9 @@ static struct ast_json *playback_to_json(struct stasis_message *message,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ast_json_pack("{s: s, s: o}",
|
||||
return ast_json_pack("{s: s, s: O}",
|
||||
"type", type,
|
||||
"playback", ast_json_deep_copy(blob));
|
||||
"playback", blob);
|
||||
}
|
||||
|
||||
STASIS_MESSAGE_TYPE_DEFN(stasis_app_playback_snapshot_type,
|
||||
|
Reference in New Issue
Block a user