mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +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:
@@ -3430,10 +3430,10 @@ static struct ast_json *rtcp_report_to_json(struct stasis_message *msg,
|
||||
}
|
||||
}
|
||||
|
||||
return ast_json_pack("{s: o, s: o, s: o}",
|
||||
"channel", payload->snapshot ? json_channel : ast_json_null(),
|
||||
return ast_json_pack("{s: o?, s: o, s: O?}",
|
||||
"channel", json_channel,
|
||||
"rtcp_report", json_rtcp_report,
|
||||
"blob", ast_json_deep_copy(payload->blob) ?: ast_json_null());
|
||||
"blob", payload->blob);
|
||||
}
|
||||
|
||||
static void rtp_rtcp_report_dtor(void *obj)
|
||||
|
Reference in New Issue
Block a user