mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-26 14:27:14 +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:
@@ -89,9 +89,9 @@ static struct ast_json *recording_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,
|
||||
"recording", ast_json_deep_copy(blob));
|
||||
"recording", blob);
|
||||
}
|
||||
|
||||
STASIS_MESSAGE_TYPE_DEFN(stasis_app_recording_snapshot_type,
|
||||
|
||||
Reference in New Issue
Block a user